Moved to https://github.com/LouCypher/userscripts/tree/master/flickr-share-userscripts
This file contains hidden or 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#makeCallbackable | |
* | |
* Copyright (c) 2012 "Cowboy" Ben Alman | |
* Licensed under the MIT license. | |
* http://benalman.com/about/license/ | |
*/ | |
Function.prototype.makeCallbackable = function() { | |
var fn = this; |
This file contains hidden or 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
//document own properties | |
console.log(Object.keys(document).sort()); | |
//document own properties & inherited properties | |
var documentPropertiesIncludeInherited = []; | |
for(var p in document) { documentPropertiesIncludeInherited.push(p); } | |
console.log(documentPropertiesIncludeInherited.sort()); | |
//document inherited properties only | |
var documentPropertiesOnlyInherited = []; |
This file contains hidden or 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
/** | |
* A simple javascript script to get the lastest images from your instagram account. | |
* Require an app to acess instagram api in order to get the access_token and user_id | |
* Require jquery for the ajax and dom manipulation | |
*/ | |
var settings = { | |
user : 'ENTER_YOUR_USER_ID_HERE', | |
access_token : 'ENTER_YOUR_USER_ACCESS_TOKEN_HERE' | |
}; |
This file contains hidden or 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 whatever global space vars you might need. | |
var mbta = { | |
// application configuration parameters | |
app : { | |
server : "http://backbonetraining.bocoup.com:8000" | |
}, | |
// application data | |
data : { | |
// station collection | |
lines : null |
This file contains hidden or 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 jsonToReadable( $jsonString) | |
{ | |
$tabcount = 0; | |
$result = ''; | |
$inquote = false; | |
$tab = " "; | |
$newline = "\n"; | |
for($i = 0; $i < strlen( $jsonString); $i++) |
This file contains hidden or 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 is now available via the official instagram api. */ | |
<?php | |
$url = $_GET['u']; | |
$r = file_get_contents($url); | |
$searchStr = 'meta property="og:image" content="'; | |
$pos = strpos($r, $searchStr); | |
$s = substr($r, $pos + strlen($searchStr)); | |
$img = substr($s, 0, strpos($s,'"')); | |
header('Location: '.$img); | |
exit; |
This file contains hidden or 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
/** | |
* The sample usage of ECMA 5 Mozilla Features Implemented in V8 | |
* https://github.com/joyent/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8 | |
* You can use thease new feature of ECMA5 on Node.js as you like. | |
* because there is no IE :) | |
* Order is deferent form original wiki. | |
* Sources are Checked on Node.js v0.5.0(unstable), v0.4.9(stable) | |
* | |
* you can execute this file. | |
* $ node ecma5_on_v8.js |
This file contains hidden or 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
Todos = SC.Application.create() | |
Todos.Todo = SC.Object.extend | |
title: null | |
isDone: false | |
Todos.todosController = SC.ArrayProxy.create | |
content: [] | |
createTodo: (title) -> |
This file contains hidden or 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 | |
/** This may be one of the most useless files in the world, but it essentially encapsulates | |
* the answers to as many interview questions as I can remember over the years. Written in PHP | |
* because ... just because. | |
**/ | |
/** | |
* Write me a program that can determine if something is a palindrome | |
* ex. A man, a plan, a canal - Panama! should count |
NewerOlder