This file contains 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 types | |
def clone(original, **newg): | |
return types.FunctionType(original.func_code, | |
dict(original.func_globals, **newg), | |
original.func_name, | |
original.func_defaults, | |
original.func_closure) | |
def inject(cls, **newg): |
This file contains 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 | |
# | |
# wlsadmin startup script for admin server | |
# | |
# chkconfig: - 75 15 | |
# description: WebLogic Admin Server | |
# processname: WLSADMIN | |
# Source function library | |
. /etc/rc.d/init.d/functions |
This file contains 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/sh | |
echo "What should the Application be called (no spaces allowed e.g. GCal)?" | |
read inputline | |
name=$inputline | |
echo "What is the url (e.g. https://www.google.com/calendar/render)?" | |
read inputline | |
url=$inputline |
This file contains 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 base64 | |
try: | |
from hashlib import sha1 | |
except ImportError: | |
from sha1 import new as sha1 | |
import random | |
import struct | |
import Crypto.Cipher.DES3 as DES3 | |
def decrypt_password(data): |
This file contains 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
#ifndef OBJC_ARC_ENABLED | |
#ifdef __has_feature | |
#define OBJC_ARC_ENABLED __has_feature(objc_arc) | |
#else | |
#define OBJC_ARC_ENABLED 0 | |
#endif | |
#endif |
This file contains 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
tell application "Finder" | |
reveal Desktop | |
activate | |
end tell |
This file contains 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
(in-ns 'user) | |
;;; for convenience, code from clojure.contrib.combinatorics | |
(defn- index-combinations | |
[n cnt] | |
(lazy-seq | |
(let [c (vec (cons nil (for [j (range 1 (inc n))] (+ j cnt (- (inc n)))))), | |
iter-comb | |
(fn iter-comb [c j] |
This file contains 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 datetime | |
def daterange(start_or_end, end=None, step=datetime.timedelta(1)): | |
"daterange([start,] stop[, step]) -> list of dates" | |
if end == None: | |
end = start_or_end | |
start = datetime.date.today() | |
current = start | |
while current < end: | |
yield current |
This file contains 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 | |
import sys | |
import json | |
def process(filename): | |
inp = open(filename, 'r') | |
data = json.load(inp) | |
inp.close() | |
entries = [x['request']['url'] for x in data['log']['entries']] |
This file contains 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
def main(filename): | |
data = open(filename).read() | |
for char in range(65,91): | |
letter = chr(char) | |
data = data.replace(letter, '_' + letter.lower()) | |
print data[1:].replace('\n_','\n').replace('_test','_test.rb') | |
NewerOlder