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
script.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://my.url.com/file.ext'; |
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
private function parseJSON(o:*, spaces:int = 1):String { | |
var str:String = ""; | |
if(getTypeof(o) == "object") { | |
str += "{\n"; | |
for(var i:* in o) { | |
str += getSpaces(spaces) + i + "="; | |
if(getTypeof(o[i]) == "object" || getTypeof(o[i]) == "array") { | |
str += parseJSON(o[i], spaces + 1) + "\n"; | |
} else { | |
var type:String = getTypeof(o[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
for d in *.sql; do echo "Database ${d/.sql/} will be created" && mysql -uroot -e "create database ${d/.sql/};" && mysql -uroot ${d/.sql/} < $d && echo "Done creating and populating ${d/.sql/}"; done |
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
var playlist = "-123 ,456-, x789"; | |
var videos = playlist.split(','); | |
var videos_count = videos.length; | |
for( var i = 0; i < videos_count; i++ ) { | |
// sanitise and remove non-numeric characters | |
var video_id = Number(videos[i].replace(/\D/g, '')); | |
// test | |
trace('videoID: [' + video_id + ']'); | |
} |
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
192.168.0.105 - - [28/Jun/2012:22:48:07 +0100] "GET /html5video HTTP/1.1" 301 323 | |
192.168.0.105 - - [28/Jun/2012:22:48:07 +0100] "GET /html5video/ HTTP/1.1" 200 1100 | |
192.168.0.105 - - [28/Jun/2012:22:48:08 +0100] "GET /html5video/chrome_japan.mp4 HTTP/1.1" 206 2 | |
192.168.0.105 - - [28/Jun/2012:22:48:08 +0100] "GET /html5video/chrome_japan.mp4 HTTP/1.1" 200 9407755 | |
192.168.0.105 - - [28/Jun/2012:22:48:09 +0100] "GET /html5video/chrome_japan.mp4 HTTP/1.1" 304 - | |
192.168.0.105 - - [28/Jun/2012:22:48:17 +0100] "GET /html5video/chrome_japan.mp4 HTTP/1.1" 206 2 | |
192.168.0.105 - - [28/Jun/2012:22:48:17 +0100] "GET /html5video/chrome_japan.mp4 HTTP/1.1" 200 9407755 | |
192.168.0.105 - - [28/Jun/2012:22:48:18 +0100] "GET /html5video/chrome_japan.mp4 HTTP/1.1" 206 65536 | |
192.168.0.105 - - [28/Jun/2012:22:48:19 +0100] "GET /html5video/chrome_japan.mp4 HTTP/1.1" 206 65536 | |
192.168.0.105 - - [28/Jun/2012:22:48:17 +0100] "GET /html5video/chrome_japan.mp4 HTTP/1.1" 206 9325219 |
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
X-UA-Compatible: IE=edge,chrome=1 |
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
# Enable CORS | |
Header append Access-Control-Allow-Origin * |
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
my_tf.addEventListener(FocusEvent.FOCUS_IN, onFocusIn); | |
my_tf.addEventListener(FocusEvent.FOCUS_OUT, onFocusOut); | |
function onFocusIn(event:FocusEvent):void { | |
setTimeout(event.target.setSelection, 50, 0, event.target.text.length); | |
} | |
function onFocusOut(event:FocusEvent):void { | |
event.target.setSelection(0,0); | |
} |
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
var elem = (document.getElementsByClassName('mentionsTextarea'))[0]; | |
elem.value = 'www.youtube.com'; | |
elem.blur(); | |
elem.value += ' '; | |
var evt = document.createEvent('KeyboardEvent'); | |
evt.initKeyEvent( | |
'keypress', | |
true, // key down events bubble | |
true, // and they can be cancelled | |
null, // Use the default view |
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
http://code.jquery.com/jquery-latest.js |