Skip to content

Instantly share code, notes, and snippets.

View effkay's full-sized avatar

Felipe Kaufmann effkay

View GitHub Profile
apiVersion: v1
kind: Pod
metadata:
name: test-site
labels:
test: site
spec:
containers:
- name: one
image: nginx
@effkay
effkay / gist:e6b5bfe64de7ee2873a9
Created January 26, 2015 12:12
selecta fuzzy autocomplete for remote git branches
git branch -r | cut -c 3- | cut -d "/" -f 2- | selecta | xargs git checkout
@effkay
effkay / 0_reuse_code.js
Created June 12, 2014 11:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
on adding folder items to thisFolder after receiving addedItems
repeat with movieFile in addedItems
tell application "iFlicks"
import movieFile without gui
end tell
end repeat
end adding folder items to
@effkay
effkay / gist:6607998
Created September 18, 2013 11:44
AR Methods to override for use with inheritance (instead of callbacks) taken from the "An intervention for AR" talk at railsconf 2013
create_or_update
create_record
update_record
@effkay
effkay / gist:6008724
Last active December 19, 2015 19:49
Rails says missing PG gem, but pg gem is in Gemfile
10] pry(#<RSpec::Core::ExampleGroup::Nested_1>)> migration_status = Dir.chdir(application_path) { `grep pg Gemfile` }
=> "gem 'pg'\n"
[11] pry(#<RSpec::Core::ExampleGroup::Nested_1>)> migration_status = Dir.chdir(application_path) { `bundle` }
=> "Using rake (10.0.4) \nUsing i18n (0.6.4) \nUsing minitest (4.7.5) \nUsing multi_json (1.7.7) \nUsing atomic (1.1.10) \nUsing thread_safe (0.1.0) \nUsing tzinfo (0.3.37) \nUsing activesupport (4.0.0) \nUsing builder (3.1.4) \nUsing erubis (2.7.0) \nUsing rack (1.5.2) \nUsing rack-test (0.6.2) \nUsing actionpack (4.0.0) \nUsing mime-types (1.23) \nUsing polyglot (0.3.3) \nUsing treetop (1.4.14) \nUsing mail (2.5.4) \nUsing actionmailer (4.0.0) \nUsing activemodel (4.0.0) \nUsing activerecord-deprecated_finders (1.0.3) \nUsing arel (4.0.0) \nUsing activerecord (4.0.0) \nUsing json (1.8.0) \nUsing airbrake (3.1.12) \nUsing diff-lcs (1.2.4) \nUsing posix-spawn (0.3.6) \nUsing grit (2.5.0) \nUsing little-plugger (1.1.3) \nUsing logging (1.8.1) \nUsing thor (0.18.1) \nUsin
#!/usr/bin/env zsh
#############################################################################
# INSTALLER SCRIPT FOR WORKSTATIONS
#############################################################################
#
# Setting up a new machine is a PTA. This makes it easier.
#
# Inspired by and with snippets from:
#
@effkay
effkay / keyboard.defaults
Created April 17, 2012 21:27
hc keyboard tuning
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Set a blazingly fast keyboard repeat rate
defaults write NSGlobalDomain KeyRepeat -int 0
@effkay
effkay / feature.rb
Created May 10, 2011 17:32
Feature Switch
module Feature
@features = {
:xmas_design => Proc.new{ Date.strptime("2010-11-27", '%Y-%m-%d').past? || ['development', 'test'].include?(Rails.env) },
:some_fancy_feature => Proc.new{ ['development', 'test', 'staging'].include?(Rails.env) },
}
def self.is_enabled?(feature)
if @features.has_key? feature
@features[feature].call
module Extranett
module Responders
module SenchaResponder
def to_json
render :json => compose_json, :status => http_status, :location => location
end
private