I hereby claim:
- I am alexwright on github.
- I am alexw (https://keybase.io/alexw) on keybase.
- I have a public key whose fingerprint is 56B0 74A6 B6EA 8A96 D951 F54D F8A8 9EB0 2E92 4159
To claim this, I am signing this object:
/** | |
* Don't let user input anywhere near this! | |
* Since the PDO::bind* methods escape a STR with 's I couldn't use them. :( | |
*/ | |
protected function get_enum ($table_name, $field_name) | |
{ | |
$sql = "desc {$table_name} {$field_name}"; | |
$st = $this->db->prepare($sql); | |
if ($st->execute()) |
/* I heard you like async loading.. | |
So I wrote an async loader blob so you can async load and async loader */ | |
(function(d) { | |
var b = document, a = b.createElement("script"), c = !1, b = b.head || b.getElementsByTagName("head"); | |
a.onload = a.onreadystatechange = function() { | |
if(!(a.readyState && "complete" !== a.readyState && "loaded" !== a.readyState || c)) { | |
a.onload = a.onreadystatechange = null, c = !0, yepnope(d) | |
} | |
}; | |
a.src = "/static/js/yepnope.js"; |
<?php | |
class ASN { | |
public static function decode ($binary_string) | |
{ | |
$parser = new ASN_Parser($binary_string); | |
return $parser->parse(); | |
} | |
public static function encode ($asn_data) |
function relativeTime(milliseconds, withoutSuffix, lang) { | |
var seconds = round(Math.abs(milliseconds) / 1000), | |
minutes = round(seconds / 60), | |
hours = round(minutes / 60), | |
days = round(hours / 24), | |
years = round(days / 365), | |
args = seconds < 45 && ['s', seconds] || | |
minutes === 1 && ['m'] || | |
minutes < 45 && ['mm', minutes] || | |
hours === 1 && ['h'] || |
def get_commit_activity(self, project): | |
from datetime import date, timedelta | |
from pygit2 import Repository | |
from pygit2 import GIT_SORT_TIME | |
repo = Repository(project.gitrepo) | |
weeks = self.get_weeks() | |
for commit in repo.walk(repo.head.oid, GIT_SORT_TIME): | |
commit_time = date.fromtimestamp(commit.commit_time) | |
commit_week = commit_time - timedelta(days=commit_time.weekday()) |
<!doctype html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>Hi</h1> | |
<div class="widget" style="padding: 2em;"> | |
<div class="some-menu-whatever"> | |
<button data-color="red" class="btn-change-color">red</button> | |
<button data-color="blue" class="btn-change-color">blue</button> |
import os | |
import EXIF | |
import datetime | |
work_dir = '../pics' | |
exif_date_format = '%Y:%m:%d %H:%M:%S' | |
for dirname, dirnames, filenames in os.walk(work_dir): | |
for filename in filenames: | |
old_file_path = os.path.join(work_dir, filename) |
a = {foo:{bar:{baz:42}}}; | |
"foo.bar.baz".split('.').reduce(function(o, i) { return o[i]; }, a); |
#!/bin/bash | |
export SSH_AUTH_SOCK=$(find /tmp/ssh-* -user `whoami` -name agent\* -printf '%T@ %p\n' | sort -k 1nr | sed 's/^[^ ]* //' | head -n 1); |
I hereby claim:
To claim this, I am signing this object: