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() { | |
var doc = document, | |
htm = doc.documentElement, | |
lct = null, // last click target | |
nearest = function(elm, tag) { | |
while (elm && elm.nodeName != tag) { | |
elm = elm.parentNode; | |
} | |
return elm; | |
}; |
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
require 'formula' | |
class Jack <Formula | |
homepage 'http://jackaudio.org' | |
version '0.87' | |
if MACOS_VERSION < 10.6 | |
url 'http://downloads.sourceforge.net/project/jackosx/JackOSX/0.87/JackOSX.0.87_32bits.zip' | |
md5 '431b35cab4b3928e66e8accb2a1dee80' | |
else | |
url 'http://downloads.sourceforge.net/project/jackosx/JackOSX/0.87/JackOSX.0.87_64-32bits.zip' |
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 a nginx config snippet showing how to inherit an http header | |
# or defaulting it to a specific value. This is useful because it allows | |
# upstream load balancers to set specific headers, but if they're missing | |
# the app LB will know how to default it. | |
# This will inherit the previously set X-Scheme variable, or otherwise | |
# default it to the current `$scheme`. Requires nginx 0.9.0+. | |
# | |
# Docs: http://wiki.nginx.org/HttpMapModule#map | |
map $http_x_scheme $x_scheme { |
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
import daemon, lockfile, signal, logging | |
import eventlet | |
from eventlet import wsgi, timeout | |
worker_pool = eventlet.GreenPool(20) | |
sock = eventlet.listen(('', 8000)) | |
def proper_shutdown(): | |
worker_pool.resize(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
#!/usr/bin/env python | |
""" | |
This Python scripts listens for all HTTP requests to the | |
Turntable CDNs and downloads the file requested into the | |
current directory. | |
Disclaimer: This is a proof of concept. The author of this | |
script is not responsible for how this is used. | |
""" |
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
Vagrant::Config.run do |config| | |
# ... | |
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | |
end |
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
import ConfigParser | |
import os | |
from fabric.api import env, sudo | |
from fabric.contrib import files | |
SERVER_ROLES = ['dbmaster', 'app', 'lb', ] | |
env.roledefs = dict.fromkeys(SERVER_ROLES, []) | |
# Directory structure |
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
import socket, ssl, json, struct | |
import binascii | |
# device token returned when the iPhone application | |
# registers to receive alerts | |
deviceToken = '39cac56f 986a0e66 3c4fd4f4 68df5598 024d2ca3 8b9f307c 741c180e 9fc30c62' | |
thePayLoad = { | |
'aps': { | |
'alert':'Oh no! Server\'s Down!', |
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
#!/usr/bin/env perl | |
# Parameters supported: | |
# | |
# config | |
# autoconf | |
# | |
# Magic markers: | |
#%# family=auto | |
#%# capabilities=autoconf |
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
#!/usr/bin/python | |
#based on the ideas from http://synack.me/blog/implementing-http-live-streaming | |
# Updates: | |
# - 2024-04-24: Apply suggestions from @Pin80 | |
# Run this script and then launch the following pipeline: | |
# gst-launch videotestsrc pattern=ball ! video/x-raw-rgb, framerate=15/1, width=640, height=480 ! jpegenc ! multipartmux boundary=spionisto ! tcpclientsink port=9999 | |
#updated command line | |
#gst-launch-1.0 videotestsrc pattern=ball ! videoconvert ! video/x-raw, framerate=15/1, width=640, height=480 ! jpegenc ! multipartmux boundary=spionisto ! #tcpclientsink port=9999 | |
from multiprocessing import Queue |
OlderNewer