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
/** | |
* Protect window.console method calls, e.g. console is not defined on IE | |
* unless dev tools are open, and IE doesn't define console.debug | |
*/ | |
(function() { | |
if (!window.console) { | |
window.console = {}; | |
} | |
// union of Chrome, FF, IE, and Safari console methods | |
var m = [ |
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
<?php | |
/** | |
* Loading this way throws an error when pointing to the wrong dir. | |
* It also makes it super simple to debug, via the $loader var. | |
*/ | |
if (($loader = require_once __DIR__ . '/../vendor/autoload.php') == null) { | |
die('Vendor directory not found, Please run composer install.'); | |
} |
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
#!/bin/bash | |
# Mine the Facebook Graph API for data. | |
# ////////////////////////////////////////////////// | |
# ////////////// Options ////////////////////////// | |
# ////////////////////////////////////////////////// | |
# | |
# -i Input file. Must contain a list of ids, | |
# separated by line. |
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
# This script gets test users' access tokens, and | |
# uploads public images to those accounts | |
# At the time of this writing, it takes an input file ( of facebook UIDs ) | |
# an queries an external JSON file for those users ( filtering ). The remaining | |
# filtered users will have images uploaded to their profiles, via the graph | |
# api. | |
require "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
#!/bin/bash | |
# Useage | |
# ./scrape list | |
# | |
# list must be a plain text file, containing | |
# image urls, separated by line. | |
# | |
# Example: | |
# http://www.example.com/foo.jpg |
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 getParameterByName(name) { | |
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} |
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
/** | |
* Protect window.console method calls, e.g. console is not defined on IE | |
* unless dev tools are open, and IE doesn't define console.debug | |
*/ | |
(function() { | |
if (!window.console) { | |
window.console = {}; | |
} | |
// union of Chrome, FF, IE, and Safari console methods | |
var m = [ |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: 'ul', | |
didReceiveAttrs() { | |
if (this.get('limit')) { | |
this.set('list.length', this.get('limit')); | |
} | |
} | |
}); |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
val1: 1, | |
val2: 2, | |
comparison: Ember.computed.equal('val1', 'val2'), | |
actions: { | |
click() { | |
this.set('val1', 2); | |
} |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didUpdateAttrs(options) { | |
console.log('I updated a value', options); | |
} | |
}); |
OlderNewer