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 get_datetime(timestamp): | |
""" | |
Returns a datetime object from str(datetime.datetime). | |
""" | |
ctor = [] | |
timestamp = timestamp.split() | |
date = [ int(i) for i in timestamp[0].split('-') ] | |
time = [ int(i) for i in timestamp[1].replace('.', ':').split(':') ] |
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
(* corrections for saolsen *) | |
(* Exercise 3.3 *) | |
let rec sum n m f = | |
if n = m then | |
f m | |
else | |
f n + sum ((n + 1) m f);; | |
let g x = x * x;; | |
sum 2 4 g;; |
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 -*- | |
# author: kyle isom | |
# license: ISC / public domain dual-license | |
# | |
# quine: a program that prints itself | |
import urllib2 | |
remote = 'http://www.kyleisom.net/quine.py.txt' |
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 | |
# simple shell script to read a manifest file and copy the files in the | |
# manifest to another dir, i.e. to build a distribution | |
if [ "$1" -a "$2" ]; then | |
MANIFEST=$1 | |
DESTDIR=$2 | |
else | |
echo "usage: distcp.sh MANIFEST DESTDIR" | |
echo " MANIFEST should be a file containing files to DESTDIR" |
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
/* | |
* written by kyle isom <[email protected]> | |
* license: isc / public domain dual license | |
* one of the functions i wrote for the lurker project | |
* (https://github.com/kisom/lurker) project | |
* | |
* from twitter (@kyleisom): | |
* '"so a char * goes to a char ** where each char * in the char ** is a line | |
* in the first char *" - me explaining my C algorithm to @qb1t' | |
*/ |
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
/* | |
* written by kyle isom <[email protected]> | |
* license: isc / public domain dual license | |
* one of the functions i wrote for the lurker project | |
* (https://github.com/kisom/lurker) | |
* | |
* C function to strip leading and trailing whitespace | |
* from a string | |
* added as a gist because I am not near a compiler or editor and want to commit | |
* my notes to memory |
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
/* | |
* written by kyle isom <[email protected]> | |
* license: isc / public domain dual license | |
* one of the functions i wrote for the lurker project | |
* (https://github.com/kisom/lurker) | |
* | |
* C function to split a line into command and value | |
*/ | |
/* |
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
/* | |
* written by kyle isom <[email protected]> | |
* license: isc / public domain dual license | |
* one of the functions i wrote for the lurker project | |
* (https://github.com/kisom/lurker) | |
* | |
* C function to split a line into command and value | |
*/ | |
/* |
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
{ | |
"settings" : { | |
"id" : "kyle", | |
"name" : "kyle isom", | |
"avatar" : "http://is.gd/JZ3Pcw?s=200", | |
"disqus_shortname" : "kisom", | |
"enable_search" : true | |
}, | |
"content" : { | |
"$ whoami" : { |
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 -*- | |
# author: kyle isom <[email protected]> | |
# license: isc / public domain dual-license | |
# | |
# automate updates to hackerhub | |
""" | |
Automate updates to hackerhub. Validates a local JSON profile, sftp's it to | |
a server, and notifies hackerhub to update the profile. | |
""" |
OlderNewer