Skip to content

Instantly share code, notes, and snippets.

View jsmestad's full-sized avatar
👾

Justin Smestad jsmestad

👾
View GitHub Profile
$.ajaxSetup({
cache: false,
dataType: 'json'
});
SC.RestDataSource = SC.DataSource.extend({
resourceURL: function(recordType, store, storeKey) {
var id, resourceName = recordType.resourceName,
prefix = this.get('storagePrefix');
@jsmestad
jsmestad / .gvimrc.local
Created July 27, 2011 23:39
Janus Modifications
color jellybeans+
" Don't show scrollbars
set guioptions-=r
set guioptions-=L
set guioptions-=T
@jsmestad
jsmestad / assets.yml
Created July 27, 2011 20:43
Rails 3.0.x runtime compilation and asset packaging with Barista and Jammit on Heroku
# config/assets.yml
package_assets: on
compress_assets: on
# compress_assets: off
javascript_compressor: uglifier
javascripts:
all:
@jsmestad
jsmestad / accessing_snapshot.rb
Created May 26, 2011 20:16
Proposed changes for Mongomatic 0.9.0
@snapshot = Snapshot.first
-----
{
:stats => {
'accounts' => { 'count' => 8 },
'subscriptions' => { 'count' => 16 }
},
:activity => [ {'ns' => 'accounts.users', ...}, {'ns' => 'subscriptions.users' =>, ...} ]
}
-----
~/Documents/Overstuffed/warehouse [ master: ✗ ] > rake recurly:clear_test_data --trace
** Invoke recurly:clear_test_data (first_time)
** Invoke recurly:load_settings (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute recurly:load_settings
** Execute recurly:clear_test_data
rake aborted!
401 Unauthorized
@jsmestad
jsmestad / element_by_text.rb
Created April 17, 2011 20:15
capybara element by text
Capybara.add_selector(:element_by_text) do
xpath { |locator| XPath.descendant[XPath.text.normalize == locator] }
end
When /^(?:|I )click "([^"]*)"$/ do |link|
begin
click_link(link)
rescue Capybara::ElementNotFound
find(:element_by_text, link).click
end
- flash.keys.each do |key|
.flash{:class => key}= flash[key]
action :create
Chef::Log.info "I am running template now"
template "/etc/file.conf" do
...
end
end
This will print Chef::Log.info at compilation step, then template will run whenever the hell it feels like it.
#!/dev/null
# This 'script' is a set of instructions for preparing and bundling an Arch
# Linux AMI for Amazon's EC2. Bits are to be run on three different
# computers, and there is interaction required, so please follow along and
# run commands individually.
# PROTIP: THESE DON'T ACTUALLY WORK. That's why I'm pasting them here,
# attemping to get some input on what I'm doing wrong. When the instructions
# are ready for prime-time, I'll clean them up and post them to my blog. If
# you're really interested, watch for it there:
@jsmestad
jsmestad / .gvimrc.local
Created January 31, 2011 21:45
customizing janus
color jellybeans+
" Don't show scrollbars
set guioptions-=r
set guioptions-=L
set guioptions-=T