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
### | |
# Copyright (c) 2011, Aaditya Bhatia | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# * Redistributions of source code must retain the above copyright notice, | |
# this list of conditions, and the following disclaimer. | |
# * Redistributions in binary form must reproduce the above copyright notice, |
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
if 'youtube' in options_db and 'youtu' in text: | |
match = re.search('https?://.*?(?:youtube\.com/|youtu\.be).*?(?:v=|/)(.*?)(?:&|#|\s|$)', text) | |
try: | |
if match: | |
id = match.group(1) | |
entry = json.loads(urllib2.urlopen("http://gdata.youtube.com/feeds/api/videos/" + id + "?alt=json").read())['entry'] | |
title = entry['title']['$t'] | |
secs = entry['media$group']['media$content'][0]['duration'] | |
viewCount = entry['yt$statistics']['viewCount'] | |
duration = "%d:%02d" % (secs/60, secs%60) |
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[href^='http']").each(function() { | |
$(this).css({ | |
background: "url(http://www.google.com/s2/u/0/favicons?domain=" + this.hostname + | |
") left center no-repeat", | |
"padding-left": "20px" | |
}); | |
}); |
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
cluster = require 'cluster' | |
if not cluster.isMaster then return require './app' | |
util = require 'util' | |
express = require 'express' | |
gitpull = require 'gitpull' | |
gitsha = require 'gitsha' | |
require 'colors' |
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
cluster = require 'cluster' | |
if not cluster.isMaster then return require 'webapp2' | |
PORT = process.env.PORT or 8000 | |
process.env.PORT = 0 | |
httpProxy = require 'http-proxy' | |
util = require 'util' | |
express = require 'express' |
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() { | |
if(typeof jQuery!='undefined') { | |
return console.log('jQuery already present: v'+jQuery.fn.jquery); | |
} | |
if(typeof($) === 'function') { | |
console.log('$ already defined. Use $jq(), not $().'); | |
} | |
var script=document.createElement('script'); | |
script.src='http://code.jquery.com/jquery-latest.min.js'; | |
var head=document.getElementsByTagName('head')[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
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$True,Position=1)] | |
[string]$outputFile | |
) | |
$data = @{} | |
function header($text) { | |
"`n" |
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
fs = require 'fs' | |
fatReader = require './fatReader' | |
fd = fs.openSync 'fatFilesystem.fat', 'r' | |
fat = fatReader.getFS(fd) | |
fatReader.log fat | |
console.log "\nReading root directory" |
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
[CmdletBinding()] | |
Param( | |
[Parameter(Position=1, Mandatory=$True)] | |
[string]$dataFile1, | |
[Parameter(Position=2, Mandatory=$True)] | |
[string]$dataFile2 | |
) | |
$dataObj1 = cat -raw "$dataFile1.json" | ConvertFrom-Json | |
$dataObj2 = cat -raw "$dataFile2.json" | ConvertFrom-Json |
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
#!/bin/bash | |
connect-otw () { | |
name=$(basename $PWD) | |
num="$1"; | |
shift; | |
( test -n "$name" || exit 3; test -f "$name$num" || exit 4; | |
sshpass -f "$name$num" ssh -q $name$num@$name.labs.overthewire.org $@ ) | |
} |
OlderNewer