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
t = 236 # seconds | |
Time.at(t).utc.strftime("%H:%M:%S") | |
=> "00:03:56" | |
# Reference | |
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time |
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/bash | |
# setup | |
FILES=name_of_file_to_match_*.mp4 | |
SEEK_POINT=00:00:30 | |
IMG_FORMAT=png | |
FRAME_SIZE=150X100 | |
DEST=thumbnails | |
for f in $FILES |
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
tap "caskroom/cask" | |
tap "caskroom/drivers" | |
tap "caskroom/fonts" | |
tap "homebrew/bundle" | |
tap "homebrew/core" | |
tap "homebrew/science" | |
tap "homebrew/services" | |
brew "ack" | |
brew "readline" | |
brew "autoconf" |
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
source ~/.aliases | |
source ~/.exports | |
source /usr/local/share/chruby/chruby.sh | |
source /usr/local/share/chruby/auto.sh | |
# load zgen | |
ZGEN_PREZTO_LOAD_DEFAULT=0 | |
source "${HOME}/.zgen/zgen.zsh" | |
# if the init scipt doesn't exist |
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
chefdk |
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
// source: https://ianpetzer.wordpress.com/2013/07/24/dont-let-ember-js-swallow-errors-in-your-promises/ | |
Ember.RSVP.configure('onerror', function(e) { | |
console.log(e.message); | |
console.log(e.stack); | |
}); |
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
import Ember from 'ember'; | |
import { task, timeout } from 'ember-concurrency'; | |
const { inject: { service } } = Ember; | |
export default Ember.Component.extend({ | |
ajax: service(), | |
result: null, | |
queryTask: task(function* (term) { | |
yield timeout(600); |
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
# Reference: http://madebydna.com/all/code/2011/06/24/eigenclasses-demystified.html | |
class Dog | |
def self.closest_relative | |
"wolf" | |
end | |
end | |
class Dog | |
class << self |
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
echo "gem: --no-ri --no-rdoc" >> ~/.gemrc |
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 :pg do | |
namespace :structure do | |
# Does exactly the same as db:structure:dump but with one important | |
# difference. It tries to use a compatible version of pg_dump. If you see | |
# the following error message, use pg:structure:dump instead. | |
# | |
# pg_dump: server version: 9.1.0; pg_dump version: 9.0.4 | |
# pg_dump: aborting because of server version mismatch | |
# rake aborted! | |
# Error dumping database |
NewerOlder