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/python | |
""" | |
Dropbox File Transfer Comparison - POC | |
This program compares the speed of uploading multiple files to dropbox using | |
both queued and parallel connections per file. | |
""" | |
import time |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Write tags to files | |
Usage: | |
tag.py "TagName" FileName1 FileName2 | |
You can use wildcards for the file name. Use quotes if spaces in tags. | |
To check if it worked, use xattr -l FileName |
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
function sort_by(attr) { | |
return function(a, b) { | |
if( a[attr] > b[attr]) { | |
return 1; | |
} else if( a[attr] < b[attr] ) { | |
return -1; | |
} | |
return 0; | |
} | |
} |
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 os, re, zipfile, shutil, tempfile | |
from lxml import etree | |
class docx(): | |
def __init__(self, docx_filename): | |
self.filename = docx_filename | |
with open(self.filename) as f: | |
self.zipfile = zipfile.ZipFile(f) |
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 | |
DATES=("2014-03-01" "2014-04-01" "2014-05-01" "2014-06-01" "2014-07-01" "2014-08-01" "2014-09-01" "2014-10-01" "2014-11-01" "2014-12-01" "2015-01-01" "2015-02-01" "2015-03-01") | |
let "counter = 1" | |
for i in "${DATES[@]}" | |
do | |
echo -n "$i" | |
echo | |
git shortlog -s -n --after=${DATES[counter-1]} --before=${DATES[counter]} |
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
using System; | |
using System.Text; | |
using System.Security.Cryptography; | |
static class Hash | |
{ | |
public static string SHA1(string text) | |
{ | |
byte[] buffer = Encoding.UTF8.GetBytes(text); | |
var sha1 = new SHA1CryptoServiceProvider(); |
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
from django.db import models | |
class TimeStampedModel(models.Model): | |
""" | |
An abstract base class model that provides self-updating 'created' | |
and 'modified' fields. | |
""" | |
created = models.DateTimeField(auto_now_add=True) | |
modified = models.DateTimeField(auto_now=True) |
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
<?php | |
$http_client_ip = ''; | |
$http_x_forwarded_for = ''; | |
$remote_addr = $_SERVER['REMOTE_ADDR']; | |
$remote_host = ''; | |
$remote_port = $_SERVER['REMOTE_PORT']; | |
$remote_user = ''; | |
$redirect_remote_user = ''; | |
$http_user_agent = $_SERVER['HTTP_USER_AGENT']; |
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 os, sys | |
import hashlib | |
def usage(full=False): | |
msg = '' | |
if full: | |
msg += 'Computes hash of a string.' + os.linesep |
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
<?php | |
try { | |
$options = array( | |
'soap_version'=>SOAP_1_2, | |
'exceptions'=>true, | |
'trace'=>1, | |
'cache_wsdl'=>WSDL_CACHE_NONE | |
); | |
$client = new SoapClient('http://soap.service-provider.com/endpoint.asmx?WSDL', $options); | |
} |
OlderNewer