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 | |
from __future__ import absolute_import, print_function, unicode_literals, division | |
import re | |
import logging | |
import threading | |
import time | |
import watchdog.events | |
import watchdog.observers |
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 | |
set -e | |
openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:4096 | |
openssl rsa -pubout -in private.pem -out public.pem |
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 PIL import ImageChops, ImageDraw | |
def create_diff_image(img1, img2): | |
""" | |
Compares two Images and either creates an Image with differences | |
outlined with red bounding boxes, or returns None if no differences | |
were found. | |
""" | |
diff_img = img2.copy() |
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 | |
header('Content-Type: text/plain'); | |
// y combinator | |
function y($F) { | |
$x = function ($f) use ($F) { | |
return $F(function () use ($f) { | |
return call_user_func_array($f($f), func_get_args()); | |
}); | |
}; |
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 | |
function classNames() { | |
return join(' ', | |
array_map( | |
function ($arg) { | |
if (is_array($arg)) { | |
$values = []; | |
foreach ($arg as $className => $show) { | |
if ($show) { |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdint.h> | |
/** | |
* Convert an IPv4 address string into a long | |
* | |
* @param ip_addr IPv4 address string to convert | |
* @return long representation of IP | |
*/ |
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 | |
identify -format '%[EXIF:*]' $1 |
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
# Configure | |
git config --global merge.tool p4mergetool | |
git config --global mergetool.p4mergetool.cmd "/Applications/p4merge.app/Contents/Resources/launchp4merge \$PWD/\$BASE \$PWD/\$REMOTE \$PWD/\$LOCAL \$PWD/\$MERGED" | |
git config --global mergetool.p4mergetool.trustExitCode false | |
git config --global mergetool.keepBackup false | |
# Use with `git mergetool` |
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 | |
lines="-\|/" | |
i=0 | |
while : ; do | |
printf "\r\033[5mReticulating splines\033[25m %s" ${lines:$i:1} | |
i=$(((i + 1) % 4)) | |
sleep 0.5 | |
done |
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
__git_ps1 () | |
{ | |
local b="$(git symbolic-ref HEAD 2>/dev/null)"; | |
if [ -n "$b" ]; then | |
printf " (%s)" "${b##refs/heads/}"; | |
fi | |
} | |
export PS1="\[\033[0;32m\][\D{%H:%M}] \[\033[0;32m\]\h:\[\033[0;33m\]\w\[\033[35m\]\$(__git_ps1) \[\033[0;36m\]\u\\$ \[\033[0m\]" |