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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
$ch = curl_init($url); | |
$fp = @fopen("../Files/System/TEST/temp.xml", "w"); | |
curl_setopt($ch, CURLOPT_FILE, $fp); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_exec($ch); | |
curl_close($ch); | |
fclose($fp); | |
$file = "../Files/System/TEST/temp.xml"; |
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
// call func after a defined interval of time | |
var debounce = function( func, wait ) { | |
var timeoutId = null; | |
// set default interval time | |
wait = wait || 200; | |
return function() { | |
var args = arguments, | |
context = this; |
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
////////////////////////// | |
// backbone fetch method | |
////////////////////////// | |
// set up fetch & callbacks | |
myCollection.fetch( options ) | |
.done( this.successHandler.call( this ) ) | |
.fail( this.errorHandler.call( this ) ); | |
////////////////////////// |
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
/** | |
* Note: this code is copied from Casey Chu( bitsofpancake )'s repo: https://github.com/bitsofpancake/youtube-loop-video | |
* and minorly changed ( remove the style block, set looping default to true ). | |
* | |
* How to use the code: when you are on a youtube video page and want to loop this video, | |
* just create a snippet in chrome dev tool ( developer tools > source > snippets ) | |
* copy this code into the snippet, and run it! | |
* | |
* The code will create a "loop" button in the UI, and by default it will set to loop the video, | |
* you can toggle the button to enable/disable looping. |