Skip to content

Instantly share code, notes, and snippets.

View mkkane's full-sized avatar

Michael Kane mkkane

  • mkkorp
  • Brighton
View GitHub Profile
@mkkane
mkkane / keybase.md
Last active February 13, 2016 13:16

Keybase proof

I hereby claim:

  • I am mkkane on github.
  • I am mkkane (https://keybase.io/mkkane) on keybase.
  • I have a public key ASDT8WCniW5GITfcKS6H7iIlym58DINBdaozcE-_zR4fwwo

To claim this, I am signing this object:

@mkkane
mkkane / twitter-api-inconsistency-max_id-since_id
Created March 11, 2015 12:40
Example of twitter search api inconsistencies
+--------------------+---------------------------+---------------------------------+-----------------------------------+
| tweet ids | {'count': 100, | {'count': 100, | {'count': 100, |
| | 'q': 'cigref', | 'max_id': 575635858893717505L, | 'max_id': 575635858893717505L, |
| | 'result_type': 'recent'} | 'q': 'cigref', | 'q': 'cigref', |
| | | 'result_type': 'recent'} | 'result_type': 'recent', |
| | | | 'since_id': 574497480571748352L} |
+--------------------+---------------------------+---------------------------------+-----------------------------------+
| 575635858893717504 | x | | |
| 575624089689268224 | x | x
@mkkane
mkkane / create-swap.sh
Created November 13, 2014 16:30
Create a swap file and install it (run as root)
#!/bin/bash
# Install a swap file on the system. The desired size (in GB) should be passed
# in as the only arg. Will use /swapfile as the filename.
SWAP_SIZE="$1" # We should be passed in swap size as number of GB.
SWAP_FILE='/swapfile'
# Make sure we have been given a valid size...
if [[ ! $SWAP_SIZE =~ ^[0-9]+$ ]]; then
@mkkane
mkkane / emoji-dict.json
Last active August 29, 2015 14:03
Emoji json. Contains twitter-id for use with e.g. https://abs.twimg.com/emoji/v1/72x72/1f3c0.png. Constructed mainly from http://www.unicode.org/~scherer/emoji4unicode/snapshot/full.html. Keyed by UCS-2 encoding for use with json.
{
"\ud83d\udd39": {
"emoji-id": "e-B76",
"codepoint": "U+1F539",
"name": "SMALL BLUE DIAMOND",
"twitter-id": "1f539"
},
"\ud83d\ude3f": {
"emoji-id": "e-34D",
"codepoint": "U+1F63F",