Skip to content

Instantly share code, notes, and snippets.

@nicksnell
nicksnell / test.php
Created February 3, 2015 11:32
Password hashing with pbkdf2 hmac, expected output is: 2258da2b7b0bf789df92dd56bec9eeda3b42d5e9cfe7ea311ed01c84f7cd2734
<?php
$hash = hash_pbkdf2('sha256', 'example', 'some salt', 100000);
echo $hash;
?>
@nicksnell
nicksnell / bbc_radio
Last active August 29, 2015 14:15 — forked from ajtucker/bbc_radio
Command line tool to get the radio station urls...
#!/usr/bin/python
import sys
from urllib2 import urlopen
from ConfigParser import ConfigParser
from StringIO import StringIO
stations = {
'radio1': '57286085',
'radio2': '57286086',
@nicksnell
nicksnell / .eslintrc.js
Created October 23, 2017 15:50
ESLint setup
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
extends: 'standard',
plugins: [
'html'
],
@nicksnell
nicksnell / keybase.md
Last active November 12, 2018 22:45
Keybase proof

Keybase proof

I hereby claim:

  • I am nicksnell on github.
  • I am nicksnell (https://keybase.io/nicksnell) on keybase.
  • I have a public key ASAHL0bIpe-MKaXfia-d3HprdaEVVDnI8wZokKFuS46omwo

To claim this, I am signing this object:

@nicksnell
nicksnell / algolia_export.py
Created July 25, 2018 15:48
Tool for exporting indexes from Algolia
"""
Export an Algolia Index to JSON.
Usage: ALGOLIA_KEY=<some key> ALGOLIA_SECRET=<some secret> ALGOLIA_INDEX=<some index> python algolia_export.py
"""
import os
import json
from algoliasearch import algoliasearch
@nicksnell
nicksnell / breed_bands.py
Created May 2, 2019 16:34
Tool for updating breed bands
"""
Tool for creating breed band mappings & updating the Algolia Index
Install:
pip install --upgrade 'algoliasearch>=2.0,<3.0'
Usage:
ALGOLIA_APP_ID= ALGOLIA_API_KEY= ALGOLIA_INDEX= python breed_bands.py
"""
@nicksnell
nicksnell / clear_auth0_users.py
Created May 22, 2019 10:54
Remove a chunk of users (100) from auth0.
import os
import time
from auth0.v3.authentication import GetToken
from auth0.v3.management import Auth0
def main():
domain = os.environ.get('AUTH0_DOMAIN')
client_id = os.environ.get('AUTH0_CLIENT')
secret = os.environ.get('AUTH0_SECRET')
@nicksnell
nicksnell / delta_dict.py
Created May 29, 2019 15:48
Recursively work out deltas of numbers in dictionaries
def delta_dict(a, b):
result = {}
for key in a.keys():
if isinstance(a[key], dict):
result[key] = delta_dict(a[key], b.get(key, {}))
else:
result[key] = a[key] - b.get(key, 0)
return result
if __name__ == '__main__':
Vue.component('example-element1', {
render: function (createElement) {
return createElement('h1', 'Example Element 1')
}
})
@nicksnell
nicksnell / Brewfile
Created October 6, 2019 19:44
Brewfile - OSX setup
# Install command-line tools using Homebrew
# Usage: `brew bundle Brewfile`
cask_args appdir: "/Applications"
tap "homebrew/cask"
tap "mas-cli/tap"
tap "dart-lang/dart"
tap "heroku/brew"
tap "d12frosted/emacs-plus"
tap "homebrew/cask-fonts"