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
# pass input file as param | |
return unless ARGV.size > 0 | |
list = ARGV[0] | |
File.readlines(list).each do |line| | |
puts `curl --data "id=#{line}&scrape=true" https://graph.facebook.com` | |
end |
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
// old way, plan to pass a func | |
function doAsyncStuff(callback){ | |
// do stuff, then call the function that was passed | |
setTimeout(callback,2000); | |
} | |
// calling it | |
doAsyncStuff(function(){ | |
console.log('internet website') |
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
>>> d = {'a': 'foo', 'b': 'bar'} | |
>>> d | |
{'a': 'foo', 'b': 'bar'} | |
# get name of matching prop | |
>>> matches = [item for item in d if d[item] =='bar'] | |
>>> matches | |
['b'] | |
# or, get the value of the match |
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
function iFramePost(form){ | |
if(!form) return; | |
if(!form.jquery) form = $(form); | |
var f = document.createElement('iframe'); | |
var target = 'iframe_target_' + (new Date).getTime(); | |
form.attr('target',target); | |
f.name = target; | |
var id = 'iframe_post_' + (new Date).getTime(); | |
f.id = id; | |
form.attr('data-iframe-post-id',id); |
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
collection = Backbone.Collection.extend( | |
initialize: -> | |
@term = "" | |
@page = "" | |
url: -> | |
"url-to-data?" + @term | |
) | |
# when user clicks a sort header, set props on collection |
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
(function(doc, script){ | |
var API_KEY = ''; // use yours | |
// tks -- http://css-tricks.com/thinking-async/ | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], | |
add = function(url, id) { | |
if (doc.getElementById(id)) {return;} | |
js = doc.createElement(script); | |
js.src = url; |
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
doctype html | |
/[if lt IE 7] | |
| <html class="ie ie6 lt-ie9 lt-ie8 lt-ie7"> | |
/[if IE 7] | |
| <html class="ie ie7 lt-ie9 lt-ie8"> | |
/[if IE 8] | |
| <html class="ie ie8 lt-ie9"> | |
/[if IE 9] | |
| <html class="ie ie9"> | |
| <!--[if (gte IE 9)|!(IE)]<!--> |
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
(function($){ | |
$(function(){ | |
// code in here | |
}) | |
})(window.jQuery) |
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
# If you have OpenSSL installed, we recommend updating | |
# the following line to use "https" | |
source 'http://rubygems.org' | |
gem "middleman", :github => "middleman/middleman" | |
gem 'middleman-sprockets', :github => "middleman/middleman-sprockets" | |
gem "stylus" | |
gem "slim" | |
gem "gist" |
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
define(['jquery', 'handlebars'],function($,Handlebars){ | |
/* use: | |
var tmpl = App.helpers.tmpl, | |
getCompiledTemplate = tmpl('foo', {}); | |
getCompiledTemplate.then(function(content){ | |
$('#something').html(content); | |
}); |
NewerOlder