This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
# add associated object's IDs as arrays for each record in collection | |
Organization.joins(:users) | |
.select("organizations.*, '#{User.joins(:organization).pluck(:id)}' as user_ids") | |
.group('organizations.id') | |
# => { organizations: [{ id: 1, name: 'some name',... user_ids:[1,2,3] }] } |
This file contains hidden or 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
# this adds an additional `user_ids` array to each of the `organizations` collection | |
json.organizations do |json| | |
json.array! @organizations do |org| | |
json.merge! org.attributes | |
json.user_ids org.users.pluck(:id) | |
end | |
end |
This file contains hidden or 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
" Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
runtime autoload/pathogen.vim | |
call pathogen#infect() | |
call pathogen#helptags() | |
" EDITOR SETTINGS ======================================================== | |
" ======================================================================== |
This file contains hidden or 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
# copy/paste into ~/.bash_profile and invoke it by typing "bb" in commandline | |
# Opens the bitbucket page for the current git repo/branch in your browser | |
function bb() { | |
giturl=$(git config --get remote.origin.url) | |
if [ "$giturl" == "" ] | |
then | |
echo "Not a git repository or no remote.origin.url set" | |
exit 1; |
This file contains hidden or 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
# copy/paste in ~/.bash_profile and invoke it by typing "gh" in commandline | |
# Opens the github page for the current git repo/branch in your browser | |
function gh() { | |
giturl=$(git config --get remote.origin.url) | |
if [ "$giturl" == "" ] | |
then | |
echo "Not a git repository or no remote.origin.url set" | |
exit 1; |
NewerOlder