Skip to content

Instantly share code, notes, and snippets.

@shello
shello / WikiEmoji.md
Last active June 16, 2016 13:40
Wiki Emoji
@shello
shello / wnd.dot
Last active August 29, 2015 14:13
/*
DOT-format Graph visualization of @wnd_* twitter accounts.
Choose Your Own Adventure by @edent.
Graph by @shello.
PNG render: http://imgur.com/O6hMqqb
Note: I'm a noob at graphviz/DOT. Excuse some obvious derp.
*/
<?php
// via https://twitter.com/joswr1ght/status/544548300033363971
var_dump(md5('240610708'));
// string(32) "0e462097431906509019562988736854"
var_dump(md5('QNKCDZO'));
// string(32) "0e830400451993494058024219903391"
var_dump(md5('240610708') == md5('QNKCDZO'));

pinboard_backup.sh

Backup your Pinboard bookmarks!

Setup

You'll need to configure the PINBOARD_API_TOKEN variable with your API token.

You may also want to change the DEFAULT_FORMAT.

@shello
shello / randomEmoji.py
Last active March 12, 2025 19:23
Random Emoji! (for Python 3)
#!/usr/bin/env python3
from itertools import accumulate
from bisect import bisect
from random import randrange
from unicodedata import name as unicode_name
# Set the unicode version.
# Your system may not support Unicode 7.0 charecters just yet! So hipster.
UNICODE_VERSION = 6
@shello
shello / onchange.sh
Last active August 29, 2015 14:02 — forked from senko/onchange.sh
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute a command
# when a file or directory is created, modified or deleted.
#
# Modified from the original by: Senko Rasic <[email protected]>
# https://gist.github.com/senko/1154509
#
# Requires:
# bash
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?php
// Adapted from http://stackoverflow.com/a/1320259
function array_flatten($array)
{
return iterator_to_array(
new RecursiveIteratorIterator(
new RecursiveArrayIterator($array)
),
false
#!/usr/bin/env sh
# Retrieves a remote file to a temporary local file, and prints its path
remotetmp() {
REMOTE_TMPFILE=`mktemp`
scp -q $1 $REMOTE_TMPFILE
if [[ $? == 0 ]]; then
print $REMOTE_TMPFILE;
fi
}
<?php
public function testSerializeAndDecryptWithStringExpires()
{
$value = 'bar';
$headers = new \Slim\Http\Headers();
$settings = array(
'cookies.encrypt' => true,