Skip to content

Instantly share code, notes, and snippets.

/*
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
and don't need to be repeated here. Anything listed here will take precedence, however.
*/
[
{ "keys": ["super+shift+n"], "command": "new_window" },
{ "keys": ["super+shift+w"], "command": "close_window" },
{ "keys": ["super+o"], "command": "prompt_open" },
{ "keys": ["super+shift+t"], "command": "reopen_last_file" },
{ "keys": ["super+alt+up"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "h", "ipp", "inl", "m", "mm"]} },
@ThroughTheNet
ThroughTheNet / rake.log
Created January 31, 2012 15:08
pry_ext_xpl error
$ be rake test_app --trace DB_NAME=sqlite3
** Invoke test_app (first_time)
** Execute test_app
** Invoke common:test_app (first_time)
** Execute common:test_app
Generating dummy Rails application...
Copying migrations...
Setting up dummy database...
** Invoke db:drop (first_time)
** Invoke db:load_config (first_time)
@ThroughTheNet
ThroughTheNet / log.txt
Created January 31, 2012 14:17
binding_of_caller build failure log
/Users/jonnie/.rbenv/versions/1.8.7-p352/bin/ruby extconf.rb
creating Makefile
make
/usr/bin/gcc-4.2 -I. -I/Users/jonnie/.rbenv/versions/1.8.7-p352/lib/ruby/1.8/i686-darwin11.1.0 -I/Users/jonnie/.rbenv/versions/1.8.7-p352/lib/ruby/1.8/i686-darwin11.1.0 -I. -I'/Users/jonnie/.rbenv/versions/1.8.7-p352/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -g -O2 -pipe -fno-common -O0 -std=c99 -c binding_of_caller.c
binding_of_caller.c:4:21: error: vm_core.h: No such file or directory
binding_of_caller.c:5:16: error: gc.h: No such file or directory
binding_of_caller.c:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
binding_of_caller.c: In function ‘binding_memsize’:
binding_of_caller.c:33: error: ‘rb_binding_t’ undeclared (first use in this function)
def order_subtotal(order, options={})
options.assert_valid_keys(:format_as_currency, :show_vat_text)
options.reverse_merge! :format_as_currency => true, :show_vat_text => true
amount = order.total
out = options.delete(:format_as_currency) ? number_to_currency(amount) : amount
content_tag(:span, out, :class => "foo")
end
@ThroughTheNet
ThroughTheNet / gist:1281199
Created October 12, 2011 13:14
adding attribute and text with nokogiri builder
builder = Nokogiri::XML::Builder.new do
root {
item {
tag "some text", :attribute => 'value'
}
}
end
@ThroughTheNet
ThroughTheNet / gist:1280974
Created October 12, 2011 11:28
Opening eigenclass
pry(main)> class Foo
pry(main)* class << self
pry(main)* puts self
pry(main)* end
pry(main)* end
#<Class:Foo>
=> nil
@ThroughTheNet
ThroughTheNet / unicorn.config.dev.rb
Created June 14, 2011 13:34 — forked from namelessjon/unicorn.config.dev.rb
Simple-ish reloading of the important parts of an app on changes
# Sample configuration file for Unicorn (not Rack)
worker_processes 1
# listen on the sinatra port
listen 4567
# feel free to point this anywhere accessible on the filesystem
pid "#{ENV['XDG_CACHE_HOME']}/unicorn.pid"
stdout_path "#{ENV['XDG_CACHE_HOME']}/unicorn.log"
@ThroughTheNet
ThroughTheNet / gist:1012076
Created June 7, 2011 11:43
cucumber abiguity errors from spree
(::) failed steps (::)
Ambiguous match of "preference settings exist":
features/step_definitions/admin/orders.rb:34:in `/^preference settings exist$/'
features/step_definitions/admin/orders.rb:34:in `/^preference settings exist$/'
You can run again with --guess to make Cucumber be more smart about it
(Cucumber::Ambiguous)
features/admin/configuration/general_settings.feature:14:in `Given preference settings exist'
@ThroughTheNet
ThroughTheNet / gist:1002566
Created June 1, 2011 15:34
mysql2 gemspec problems
this doesnt work:
$ gem spec mysql2 --version "0.2.7" --remote
ERROR: Unknown gem 'mysql2'
this works:
$ gem spec mysql2 --remote
--- !ruby/object:Gem::Specification
name: mysql2
########################### api|mysql (features) ###########################
rm api/Gemfile*
cd api && /Users/jonnie/.rvm/gems/ree-1.8.7-2011.03@flowers/bin/rake test_app DB_NAME='mysql'
rake/gempackagetask is deprecated. Use rubygems/package_task instead
run rails new test_app --database=mysql -GJTq --skip-gemfile from "./spec"
WARNING: Global access to Rake DSL methods is deprecated. Please Include
... Rake::DSL into classes and modules which use the Rake DSL methods.
WARNING: DSL method ApiTestAppGenerator#mv called at ../lib/generators/spree/test_app_generator.rb:65:in `create_databases_yml'
run rake spree_core:install from "./test_app"
(in /Users/jonnie/projects/flowers/spree/api/spec/test_app)