Skip to content

Instantly share code, notes, and snippets.

Ken Collins metaskills

Block or report user

Report or block metaskills

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:9591491

Reciprocal Needs in the Employment Relation

We can look at two sides of the management coin: What do the individuals get out of it? And what benefit does the whole system derive from it?

I will disregard any benefits that accrue to managers just by holding the position of managing. Those are just circular logic. Circular logic abounds in discussions of management and hierarchy. For example, consider status reports. It will be said that status reports are necessary so managers know what their employees are working on. It’s

@metaskills
metaskills / clean.sh
Last active Jan 4, 2016
OS X Command To Clean All Whitespace From A Rails Project
View clean.sh
find app config db spec test -type f -name '*.rb' -or -name '*.coffee' -or -name '*.erb' -or -name '*.jbuilder' -or -name '*.js' | xargs sed -i '' -E "s/[[:space:]]*$//" | xargs sed -i -E '$a\'
@stevenharman
stevenharman / _angularjs_and_rails_asset_pipeline.md
Last active Apr 30, 2016
Load the Angular.js $templateCache while building assets for Rails Asset Pipeline. Be sure in require the `templates` module as a dependency of your Angular.js app.
View _angularjs_and_rails_asset_pipeline.md

AngularJS + Rails Asset Pipeline

This is my hand-rolled solution for getting Angular assets (Controllers, Models, Directives, Templates, etc.) integrated into the Rails Asset Pipeline.

Templates and the $templateCache

Of particular note: this hack will also load the AngularJS $templateCache with your templates, while allowing you to use Slim, ERB, etc. to write your templates.

@jbenet
jbenet / simple-git-branching-model.md
Last active May 20, 2019
a simple git branching model
View simple-git-branching-model.md

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@maccman
maccman / jquery.ajax.queue.coffee
Last active Jan 13, 2018
Queueing jQuery Ajax requests. Usage $.ajax({queue: true})
View jquery.ajax.queue.coffee
$ = jQuery
queues = {}
running = false
queue = (name) ->
name = 'default' if name is true
queues[name] or= []
next = (name) ->
@ebeigarts
ebeigarts / RAILS_RELATIVE_URL_ROOT.md
Last active Feb 13, 2019
RAILS_RELATIVE_URL_ROOT
View RAILS_RELATIVE_URL_ROOT.md

RAILS_RELATIVE_URL_ROOT

Rails

By default RAILS_RELATIVE_URL_ROOT is used only for asset pipeline.

To namespace your rails routes you need to wrap run MyApp::Application with map in your config.ru:

map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do
@KevinTriplett
KevinTriplett / capybara_wait_until.rb
Last active Dec 14, 2015
Adding back the #wait_until to Capybara v2+ gem. Can probably be adapted for cucumber tests.
View capybara_wait_until.rb
# add this file capybara_wait_until.rb to your /test directory
module Capybara
class Session
##
#
# Retry executing the block until a truthy result is returned or the timeout time is exceeded
#
# @param [Integer] timeout The amount of seconds to retry executing the given block
#
@pragdave
pragdave / gist:4981930
Created Feb 19, 2013
The Ruby 2 prepend() method makes method chaining a lot easier.
View gist:4981930
module SystemHook
private
def system(*args)
super.tap do |result|
puts "system(#{args.join(', ')}) returned #{result.inspect}"
end
end
end
class Object
@domenic
domenic / interop.md
Last active Mar 20, 2019
`module.exports =` and ES6 Module Interop in Node.js
View interop.md

module.exports = and ES6 Module Interop in Node.js

The question: how can we use ES6 modules in Node.js, where modules-as-functions is very common? That is, given a future in which V8 supports ES6 modules:

  • How can authors of function-modules convert to ES6 export syntax, without breaking consumers that do require("function-module")()?
  • How can consumers of function-modules use ES6 import syntax, while not demanding that the module author rewrites his code to ES6 export?

@wycats showed me a solution. It involves hooking into the loader API to do some rewriting, and using a distinguished name for the single export.

This is me eating crow for lots of false statements I've made all over Twitter today. Here it goes.

@ryandotsmith
ryandotsmith / hack-reactor.md
Last active Sep 27, 2018
Hack Reactor Talk
View hack-reactor.md

Tales From a Heroku User

Here are some things I have learned along the way.

Last Updated: 2013-02-08

Original Audience: Hack Reactor

About

You can’t perform that action at this time.