Skip to content

Instantly share code, notes, and snippets.


Eaden McKee eadz

View GitHub Profile
View to_proc.curry.rb
changer = "Hello X World".method(:tr)"X")"Z") # => Hello Z World"Y") # => Hello Y World
eadz / ruby-redux.rb
Last active Jun 12, 2020
Redux in Ruby
View ruby-redux.rb
# Redux in Ruby
class Store
attr_reader :state
def initialize(initial_state, *reducers)
@reducers = reducers
@state = initial_state || {}

Keybase proof

I hereby claim:

  • I am eadz on github.
  • I am eadz ( on keybase.
  • I have a public key ASB8MgwUsH_RlBmuVFwgEvvyCSZbcAo11tXpd570OIrxfgo

To claim this, I am signing this object:

eadz / gist:10220496
Created Apr 9, 2014
slack custom css
View gist:10220496
User Stylesheet for Slack.
Use with
to make a custom css Bookmarket
.light_theme .message {
eadz / time.rb
Created Sep 27, 2013
Ruby missing time
View time.rb
» Time.parse("1 Jan 1111") + 1.year
=> 1111-12-25 00:00:00 +1000
» Time.parse("1 Jan 1500") + 1.year
=> 1500-12-23 00:00:00 +1000
» Time.parse("1 Jan 1900") + 1.year
=> 1901-01-01 00:00:00 +1000
View bigredbutton.rb
#!/usr/bin/env ruby
# Eaden McKee <>
# First Big Red Button Version
# Forked from DelcomLightHid
# ( for a different device)
# Originally by
# Ian Leitch <>, Copyright 2010 Envato
# * Original single light RGY version
View JS Barcode Scanner Example
<!DOCTYPE html>
<meta charset="utf-8" />
<script src=""></script>
keycode = {
getKeyCode : function(e) {
View Capfile
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy'
desc "Link in the production database.yml"
task :after_update_code do
run "ln -nfs #{deploy_to}/#{shared_dir}/config/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{deploy_to}/#{shared_dir}/config/amazon_s3.yml #{release_path}/config/amazon_s3.yml"
View Money Specs.rb
require 'spec_helper'
describe Price do
it "formats a price correctly" do == '$1.00' == '$3.40' == '$30.00' == '$30.01' == '$3,000.00' == '$0.10'
View remove a git submodule
Let’s say that you have a submodule in your project called ’submodule1′ and it’s in the following path: ‘vendors/submodule1′. In git there are 3 traces of this this submodule:
1) .gitmodules
2) .git/config
3) the submodule entry in the index/commit itself.
To remove the first two, is really simple, you just edit those files and remove the lines that specify the submdoule. In order to delete the third and last trace of the submodule in git, you need to type the following command:
git rm --cached path/to/submodule
Note: Do not put a trailing slash at the end of path. If you put a trailing slash at the end of the command, it will fail.
UPDATE a submodule
You can’t perform that action at this time.