In addition to the techniques described in the
Asynchronous Routing Guide,
the Ember Router provides powerful yet overridable
conventions for customizing asynchronous transitions
between routes by making use of error
and loading
substates.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Ben Hyrman | |
email = ben.hyrman@gmail.com | |
[core] | |
autocrlf = true | |
editor = vim | |
excludesfile = C:\\Users\\Ben\\Documents\\gitignore_global.txt | |
[credential] | |
helper = !~/AppData/Roaming/GitCredStore/git-credential-winstore | |
[merge] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1] pry(main)> Class.new.respond_to?(:define_method) | |
=> false | |
[2] pry(main)> Module.new.respond_to?(:define_method) | |
=> false | |
[3] pry(main)> Class.new.send(:define_method, :yup) {} | |
=> #<Proc:0x00000100a08cb8@(pry):3 (lambda)> | |
[4] pry(main)> Module.new.send(:define_method, :yup) {} | |
=> #<Proc:0x00000100d8f468@(pry):4 (lambda)> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Namespace.extend = (src, obj = {}) -> | |
if typeof obj.init is 'function' | |
newObj = obj.init | |
delete obj.init | |
else | |
newObj = -> | |
newObj.prototype = Object.create src.prototype | |
newObj.prototype.constructor = newObj | |
for prop of obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This pre-commit hook will prompt for every file that contains a `console.log`, `debugger` | |
# or `puts` statement. This should avoid stupidly commiting debugging information :) | |
exec < /dev/tty | |
confirm() { | |
echo "${1:-Are you sure? [y/N]}" | |
read -r response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: redis-cli publish message.achannel hello | |
require 'sinatra' | |
require 'redis' | |
conns = Hash.new {|h, k| h[k] = [] } | |
Thread.abort_on_exception = true | |
get '/' do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# First, set the width/height DPI on the file | |
sips -s dpiWidth 144 -s dpiHeight 144 "$1" | |
# Fake that it is a screen capture (wat?) | |
xattr -wx com.apple.metadata:kMDItemIsScreenCapture "62 70 6C 69 73 74 30 30 09 08 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09" "$1" | |
xattr -wx com.apple.metadata:kMDItemScreenCaptureType "62 70 6C 69 73 74 30 30 59 73 65 6C 65 63 74 69 6F 6E 08 00 00 00 00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12" "$1" | |
xattr -wx com.apple.FinderInfo "00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Component { | |
constructor(o) { | |
this.components = {}; | |
this.listeners = {}; | |
} | |
init(o) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/mhenrixon/sidekiq-unique-jobs/issues/161 | |
# Even worse: https://github.com/mhenrixon/sidekiq-unique-jobs/issues/234 | |
class SidekiqUniqueJobsHashCompactor | |
include Sidekiq::Worker | |
sidekiq_options queue: "slow" | |
def perform | |
# Skip if there are jobs queued... | |
return unless Sidekiq::Queue.all.select { |q| q.size > 100 }.blank? |