View my-notion-quote.json
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
[ | |
{ | |
"author": "First Author", | |
"content": "First Quote." | |
}, | |
{ | |
"author": "Second Author", | |
"content": "Second Quote." | |
} | |
] |
View asker.rb
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
class Asker < ActiveRecord::Base | |
has_many :questions | |
belongs_to :user | |
accepts_nested_attributes_for :user | |
end |
View gist:5745566
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
➜ dukerson.github.io git:(master) jekyll --server | |
/Users/alagu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:203:in `parse': (/Users/alagu/Code/blog/dukerson.github.io/_config.yml): found unexpected ':' while scanning a plain scalar at line 11 column 10 (Psych::SyntaxError) | |
from /Users/alagu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:203:in `parse_stream' | |
from /Users/alagu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:151:in `parse' | |
from /Users/alagu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:127:in `load' | |
from /Users/alagu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:297:in `block in load_file' | |
from /Users/alagu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:297:in `open' | |
from /Users/alagu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/psych.rb:297:in `load_file' | |
from /Users/alagu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/gems/1.9.1/gems/jekyll-0.12.1/lib/jekyll.rb:130:in `configuration' | |
from /Users/alagu/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/gems/1.9.1/gems/jekyll-0 |
View gist:2792462
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
[14] irb(main)> k = {:i => 1} | |
=> {:i=>1} | |
[15] irb(main)> n[k] = 5 | |
=> 5 | |
[16] irb(main)> n | |
=> {{:i=>1}=>5} |
View gist:2760474
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
$(window).keydown(function(e) { | |
if (event.keyCode === 13) { | |
if ((navigator.userAgent.indexOf('Mac OS X') !== -1) && e.metaKey) { | |
return saveBookmark(); | |
} else if ((navigator.userAgent.indexOf('Mac OS X') === -1) && e.ctrlKey) { | |
return saveBookmark(); | |
} | |
} | |
}); |
View gist:1939374
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
class SampleInherit | |
include Comparable | |
def <=>(anOther) | |
if anOther.respond_to? 'str' and self.respond_to? 'str' | |
self.str.size <=> anOther.str.size | |
elsif anOther.respond_to? 'num' and self.respond_to? 'num' | |
self.num <=> anOther.num | |
elsif anOther.respond_to? 'num' and self.respond_to? 'str' | |
self.str.size <=> anOther.num |
View _block_layout.html.erb
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
<li class="result-block <%= result[:type] %>"> | |
<div class="subject"> | |
<%= yield :subject %> | |
</div> | |
<div class="snippet"> | |
<%= yield :snippet %> | |
</div> | |
</li> |
View gist:1228425
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
// | |
// MyController.h | |
// | |
// Created by Ben Copsey on 20/07/2009. | |
// Copyright 2009 All-Seeing Interactive. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <GHUnit/GHUnit.h> | |
@class ASINetworkQueue; |
View gist:178319
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
javascript:void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i%3Ca.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')%3E=0&&s.href)%20{var%20h=s.href.replace(/(&|%5C?)forceReload=\d+/,'');s.href=h+(h.indexOf('?')%3E=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}})(); |
View gist:138700
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 getpass | |
from pydelicious import DeliciousAPI, DeliciousItemExistsError | |
sourceUser = raw_input("Username [source]: ") | |
sourcePasswd = getpass.getpass("Password [source]: ") | |
sourceDlcs = DeliciousAPI(sourceUser, sourcePasswd) | |
print "Getting all bookmarks from source:" + sourceUser | |
sourceBkmrks = sourceDlcs.posts_all()['posts'] | |
print "Done getting bookmarks" | |
fromTag = ' from:' + sourceUser | |
destUser = raw_input("Username [destination]: ") |
NewerOlder