Skip to content

Instantly share code, notes, and snippets.

View randallb's full-sized avatar
🎬

Randall Bennett randallb

🎬
View GitHub Profile
@randallb
randallb / gist:5122003
Created March 9, 2013 01:21
New stencil format
<ul playlist>
<li entry>
</li>
</ul>
<ul queue>
<li entry>
</li>
var numberConv;
numberConv = function(x) {
var octet1, octet2, octet3, octet4;
octet1 = x % 256;
octet2 = Math.floor(x / 256);
octet3 = Math.floor(x / (256 * 256));
octet4 = Math.floor(x / (256 * 256 * 256));
return new Buffer([octet1, octet2, octet3, octet4]);
};
Template in HTML:
<widget>
This is a widget
</widget>
After compilation:
<widget ng-click="standardMethod">
This is a widget.
</widget
respond_to do |format|
format.html {render :angular, layout: 'output'}
format.json {render :xhr, layout: false}
end
sc = new RC.shortcut;
sc.queue(function(chain){
chain.take()
chain.load()
chain.dothing()
})
// chain just adds that to a queue, and when the fn returns, you execute the queue in order.
undefined method `[]' for nil:NilClass
twitter (4.7.0) lib/twitter/client.rb:97:in `block in request_setup'

What's your name?

Email address?

What's your story? (Tell us what you'd tell someone at a party if they asked about you.)

Why do you want to learn to code?

Do you have an app idea already? (Not required, just curious what you're interested in.)

traceroute to 198.58.104.178 (198.58.104.178), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 3.709 ms 0.814 ms 0.788 ms
2 73.90.52.1 (73.90.52.1) 8.805 ms
te-0-0-0-4-ur10.beaverton.or.bverton.comcast.net (68.85.148.217) 9.561 ms 8.515 ms
3 ae-3-0-ar03.troutdale.or.bverton.comcast.net (68.85.243.165) 9.016 ms 10.259 ms 10.287 ms
4 68.86.95.89 (68.86.95.89) 16.794 ms
pos-2-4-0-0-cr01.seattle.wa.ibone.comcast.net (68.86.91.197) 18.093 ms
68.86.95.89 (68.86.95.89) 15.624 ms
5 be-16-pe03.seattle.wa.ibone.comcast.net (68.86.83.10) 13.838 ms 15.868 ms 14.043 ms
6 ae13.bbr01.wb01.sea02.networklayer.com (75.149.228.38) 13.208 ms 14.446 ms 13.963 ms
describe 'relativeDate', ->
beforeEach module 'relativeDate'
it 'should return `just now` if the date is within the last minute', inject (relativeDate) ->
referenceDate = new Date
console.log referenceDate
expect(relativeDate(referenceDate)).toBe("just now")
it 'should return `a minute ago` if the date is older than 7/10ths of a minute but less than 1.5 minutes'
it 'should return `x minutes ago` if the date is older than 1.5 minutes but less than 55 minutes'
{"created_at":"2013-08-19T12:12:41-06:00","id":4778,"live":false,"name":"Back to school pics","org_id":31,"slug":"back-to-school-pics","updated_at":"2013-08-19T12:12:41-06:00","user_id":null,"entries":[{"author_handle":null,"author_image":"http://graph.facebook.com/100004235194478/picture?type=large","author_name":"Sabrina Ross Barrios","channel_id":null,"created_at":"2013-08-19T12:13:13-06:00","id":173101,"image":"http://sphotos-b.xx.fbcdn.net/hphotos-prn2/q75/s480x480/1175726_225027790981726_1044342005_n.jpg","likes":2,"message":"Nathans 1st day in 1st grade love you have a great day","org_id":31,"playlist_id":4778,"position":1,"post_id":null,"posted_at":"2013-08-19T10:09:21-06:00","retweets":null,"service_data":{"created_time":"2013-08-19T16:09:21+0000","from":{"name":"Sabrina Ross Barrios","id":"100004235194478"},"message":"Nathans 1st day in 1st grade love you have a great day","likes":{"data":[{"category":"Tv channel","category_list":[{"id":"169056916473899","name":"Broadcasting & Media Production"}],"n