Skip to content

Instantly share code, notes, and snippets.

View blackrobot's full-sized avatar
🖖
coffee

Damon Jablons blackrobot

🖖
coffee
View GitHub Profile
function init_map() {
var places = [
{ name: "Place 1", coords: new google.maps.LatLng(30.728752, -73.995525)},
{ name: "Place 2", coords: new google.maps.LatLng(30.733673, -73.990028)},
{ name: "Place 3", coords: new google.maps.LatLng(40.725778, -73.992249)}
]
var myOptions = {
zoom: 14,
center: places[0].coords,
function init_map() {
var places = [
{ name: "Place 1", coords: new google.maps.LatLng(30.728752, -73.995525)},
{ name: "Place 2", coords: new google.maps.LatLng(30.733673, -73.990028)},
{ name: "Place 3", coords: new google.maps.LatLng(40.725778, -73.992249)}
]
var myOptions = {
zoom: 14,
center: places[0].coords,
@blackrobot
blackrobot / Eggnog Recipe
Created December 8, 2010 16:45
A Python recipe for Egg Nog
#!/usr/bin/env python
from measurments.abstract import SPRINKLE
from delicious import GOOD
def mix_ingredients(ingredients):
mixture = []
for key in ingredients.iterkeys():
mixture.append("%s: %s" % (key, ingredients[key]))
egg_nog = {
'egg_yolks': 12,
'lbs_sugar': 1,
'cups_rum': 2,
'cups_bourbon': 2,
'quarts_whipping_cream': 2,
'egg_whites': 12,
'nutmeg': 'sprinkle',
}
webhost1:~# /usr/sbin/useradd -o -u 0 hope
Adding user `hope' ...
Adding new group `hope' (1001) ...
Adding new user `hope' (1001) with group `hope' ...
Creating home directory `/home/hope' ...
Copying files from `/etc/skel' ...
Password: dragostea mea pentru
Password again: dragostea mea pentru
Changing the user information for hope
<VirtualHost *:80>
ServerName acm25-9.acm.org
<Directory /var/www/vhosts/pubs/ciedev/html/ >
Order deny,allow
Allow from all
</Directory>
### You can uncomment the next three lines to partition logs for this site, just change the log paths.
# LogLevel warn
@blackrobot
blackrobot / ls.py
Created October 1, 2011 17:28
making an xml request, and turning it into xml
>>> import requests # http://python-requests.org
>>> headers = {'User-Agent': "Public App ID Goes Here/1.0", 'X-PAPPID': "private.app.id.goes.here"}
>>> response = requests.get('http://10.0.23.10:9630/api/invoices/', headers=headers, auth=("username", "password"))
# Or for a post, just change the .get to a .post/.put/.delete ...
>>> data = {'here': "is", 'my': "data", 'for': "posting"}
>>> response = requests.post('http://10.0.23.10:9630/api/invoices/', data=data, headers=headers, auth=("username", "password"))
# Now to decode the response xml to python
>>> from BeautifulSoup import BeautifulStoneStoup as BSS
@blackrobot
blackrobot / eggnog.js
Created October 24, 2011 15:54 — forked from kayluhb/eggnog.js
eggnog code
var eggYolks = 12,
lbsSugar = 1,
cupsRum = 2,
cupsBourbon = 2,
quartsWhippingCream = 2,
eggWhites = 12,
nutmeg = "sprinkle";
var eggNog = [eggYolks, lbsSugar, cupsRum,
cupsBourbon, quartsWhippingCream,
try:
import extra_ram
except:
from future import memory_leak_fix
else:
print "Profit???"
% ./ievms.sh ~WORKSPACE/ievms
Checking for VirtualBox
Checking for Oracle VM VirtualBox Extension Pack
Pack no. 0: Oracle VM VirtualBox Extension Pack
Building IE7 VM
Checking for existing VHD at /home/damon/.ievms/vhd/IE7/Windows Vista.vhd
Checking for downloaded VHD at /home/damon/.ievms/vhd/IE7/Windows_Vista_IE7.part01.exe
Downloading VHD from http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_Vista_IE7.part0{1.exe,2.rar,3.rar,4.rar,5.rar,6.rar} to /home/damon/.ievms/
[1/6]: http://download.microsoft.com/download/B/7/2/B72085AE-0F04-4C6F-9182-BF1EE90F5273/Windows_Vista_IE7.part01.exe --> Windows_Vista_IE7.part01.exe