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
| # ISO 3166-1 Countries and country codes in a list of tuples | |
| # Useful for Django model choice fields and dropdowns | |
| # http://www.iso.org/iso/english_country_names_and_code_elements | |
| countries = [ | |
| ("AF","Afghanistan"), | |
| ("AL","Albania"), | |
| ("DZ","Algeria"), | |
| ("AS","American Samoa"), | |
| ("AD","Andorra"), |
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 | |
| # Run as cronjob to have a daily fresh desktop | |
| # background from the NASA Image of the day gallery. | |
| # You might need to install BeautifulSoup and appscript | |
| # easy_install BeautifulSoup appscript | |
| from os.path import basename | |
| from BeautifulSoup import BeautifulStoneSoup | |
| from appscript import app, mactypes | |
| from urllib2 import urlopen |
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 node | |
| // Use to load test Faye node.js comet server | |
| // $ ./bayeux_load_client.js [number_of_clients] | |
| var repl = require('repl'); | |
| var sys = require('sys'); | |
| var faye = require('./faye-node'); | |
| var room = '/chat/demo'; |
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 node | |
| var http = require('http'), | |
| faye = require('./faye-node'); | |
| var received = 0, | |
| sent = 0; | |
| function getTimestamp () { | |
| return(new Date()); |
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
| #user nobody; | |
| worker_processes 1; | |
| worker_rlimit_nofile 500000; | |
| events { | |
| worker_connections 500000; | |
| } | |
| http { |
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 http = require('http'), | |
| host = 'aws01', | |
| creation_delay = 5, | |
| reporting_delay = 3000, | |
| clients = [], | |
| limit = process.argv[2] || 500, | |
| headers = { | |
| 'Host' : host | |
| }; |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <errno.h> | |
| #include <fcntl.h> | |
| #include <dirent.h> | |
| #include <linux/input.h> | |
| #include <sys/types.h> | |
| #include <sys/stat.h> |
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 | |
| """ | |
| Prints data from zmq PULL socket to stdout | |
| """ | |
| import zmq | |
| import sys | |
| def get_socket(host, port): | |
| context = zmq.Context() |
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 | |
| # | |
| # Recursively convert image files in IN_DIR into smaller jpegs | |
| # Copy all other files straight over | |
| # Resulting files (including folder structure) ends up in in IN_DIR/../thumbs/ | |
| IN_DIR=$1 | |
| is_image() { | |
| local name=$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
| #! /usr/bin/env python | |
| # https://s3.amazonaws.com/assets.controlanything.com/manuals/R4xR8xPro.PDF | |
| # Example usage to turn on relay index 1 3 and 6: | |
| # ./relay.py --on 1 3 6 | |
| import serial | |
| import time | |
| class Relay(serial.Serial): |
OlderNewer