Open Source Contributions

Added the ability to delete a deployment

#1304
by
jer-k
|
2020-11-12

Hello, I recently started working on the ability for my company's application to use the Deployments API and I noticed that there was no way to delete the Deployments through Octokit. We make new environments on every Pull Request so without the ability to delete the Deployments, our Environments section is going to become overrun. I was hoping to add this functionality to Octokit rather than having to hit the Github API directly.

Added the ability to toggle the Carbon toolbar and adjust the margin

#873
by
jer-k
|
2020-09-16

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
    • It appears there are no tests for the highlight-code module
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation content changes

Other information

I opened the issue on the https://github.com/deckgo/gatsby-remark-highlight-code project due in part to having no idea where this code actually lived. A big thank you to @peterpeterparker for directing me over here!

Issue Number: deckgo/gatsby-remark-highlight-code#21

For the example, I copied the <h1>Without line numbers</h1> example. The Github diff is being silly and showing my added changes above my <h1>Without dots</h1> when I actually added code below that. Also open to changing the content of the example if not as much is needed.

Add handler for rejections from ActionCable

#32
by
jer-k
|
2020-01-31

I recently implemented a rejection protocol in our ActionCable setup following the example here https://api.rubyonrails.org/classes/ActionCable/Channel/Base.html#class-ActionCable::Channel::Base-label-Rejecting+subscription+requests

Essentially we're allowing people to gain a connection to the server, but we want to reject their subscriptions if they are not authorized to view a certain channel. I noticed that the gem didn't support this.

I wasn't sure if anything more was needed in the README?

Tests are still all 💚

rspec
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Randomized with seed 18484

ActionCableClient
  with empty WebSocketClient
    #connected
      sets the callback
    #disconnected
      sets the callback
      sets subscribed to false
    #handle_received_message
      is not a ping
        yields whatever
        does not call _pinged_callback
      is a welcome
        subscribes
        calls _connected_callback
      is a rejection
        calls _rejected_callback
      is a ping
        nothing is yielded
        calls _pinged_callback
      empty messages are ignored
        dont yield
    #subscribed
      once the callback is set, receiving a subscription confirmation invokes the callback
      sets the callback
    #subscribe
      sends a message
    #reconnect!
      asks EventMachine to reconnect on same host and port
      fires EventMachine::WebSocket::Client #post_init
    #perform
      dispatches the message
      does not add to the queue
    #dispatch_message
      calls sends when subscribed
      does not send if not subscribed
    #pinged
      sets the callback
    #is_ping?
      is a ping
      is not a ping when it is a confirmation
      is not a ping
    #check_for_subscribe_confirmation
      is a subscribtion confirmation

ActionCableClient::MessageFactory
  requires a proper channel name
  initializes with a channel name
  builds the identifier based off the channel name
  #create
    creates a message
  #build_data
    returns a constructed hash, given a message
    returns a constructed hash, given empty message

ActionCableClient::Message
  sets the attributes
  #to_json
    when data is present
      double the identifier and the data if the value would be 0
      double the identifier and the data if the value would be 1
      double the identifier and the data if the value would be #<Object:0x00007fd20ee26868>
      double the identifier and the data if the value would be [nil]
      double the identifier and the data if the value would be "a"
      double the identifier and the data if the value would be {nil=>0}
      double the identifier and the data if the value would be true
      double the identifier and the data if the value would be 2020-01-31 10:32:09 -0800
    when data is not prsent
      does not set :data if the value would be {}
      does not set :data if the value would be " "
      does not set :data if the value would be "  \n\t  \r "
      does not set :data if the value would be " "
      does not set :data if the value would be "   "
      does not set :data if the value would be []
      does not set :data if the value would be nil
      does not set :data if the value would be ""
      does not set :data if the value would be false

Finished in 0.02507 seconds (files took 0.41653 seconds to load)
49 examples, 0 failures

Randomized with seed 18484

Coverage report generated for RSpec to /Users/jeremy/workspace/jer-k/action_cable_client/coverage. 179 / 184 LOC (97.28%) covered.

Allow multiple origins to be set

#15
by
jer-k
|
2016-02-09

This is a fix for #12.
Trying what you suggested in the issue didn't resolve the issue. I did plug CORSPlug, origin: "http://localhost:8080 http://localhost:8880 http://localhost:8888"

And received this error
screen shot 2016-02-09 at 3 20 51 pm

The definition for Access-Control-Allow-Origin says Note: In practice the origin-list-or-null production is more constrained. Rather than allowing a space-separated list of origins, it is either a single origin or the string "null". so I made changes to implement that.

Move webpack-isomorphic-tools-configuration inside src/

#52
by
jer-k
|
2016-02-02

Someone reported that running the latest develop branch by running npm install -g . causes the following error.

/usr/local/lib/node_modules/gluestick/webpack-isomorphic-tools-configuration.js:14
const { additionalLoaders, additionalPreLoaders } = require("./src/lib/get-webpack-additions")(true);
^

SyntaxError: Unexpected token {

This was because webpack-isomorphic-tools-configuration.js wasn't being run through Babel so the use the const was not supported. Moving the file inside the src directory ensure that it is included when run-through-babel.js is invoked.

Generate Reducer and Container tests

#51
by
jer-k
|
2016-02-01

We should have a basic test for everything we generate to encourage users to write tests!

Extendable Webpack

#44
by
jer-k
|
2016-01-28

Some users may want to extend the Webpack settings that have been defined in Gluestick with their own Preloaders and Loaders. This change allows them to specify those Preloaders and Loaders in webpack-additions.js and then Gluestick will add them.

Plugins not currently supported.

Custom redux middleware

#40
by
jer-k
|
2016-01-27

User's of Gluestick may need to add custom redux middleware. This provides them with a way to do so. This also provides auto-upgrade support for this feature.

A precursor to this request is: TrueCar/gluestick-shared#1

Custom Redux Middleware

#1
by
jer-k
|
2016-01-27

createStore takes in a customMiddleware param which is added after the promiseMiddleware and thunk. Some middleware, like redux-logger, has to be the last middleware added thus customMiddleware is added after.

This is a precursor to: TrueCar/gluestick#40