Skip to content

Instantly share code, notes, and snippets.

View danpalmer's full-sized avatar

Dan Palmer danpalmer

View GitHub Profile
import random
import copy
ALPHABET = [
"A","B","C","D","E","F","G","H","I","J","K","L","M","N",
"O","P","Q","R","S","T","U","V","W","X","Y","Z", " "]
class Scrambler(object):
"""A single scrambling unit used in the machine."""
def __init__(self, seed):
super(Scrambler, self).__init__()
<script type="text/javascript" src="/js/jquery.complexify.js"></script>
<script type="text/javascript">
$("#password").complexify({}, callback(valid, complexity){
alert("Password complexity: " + complexity);
});
</script>
#!/bin/sh
# bin/detect <build-dir>
# This buildpack is valid for use in project with a Build directory
if [ -d $1/Build ]; then
echo "Hammer Buildpack"
exit 0
else
exit 1
fi
#!/usr/bin/env bash
# bin/compile <build-dir> <cache-dir>
set -e
BUILD_DIR=$1
CACHE_DIR=$2
BUILDPACK_DIR=`cd $(dirname $0); cd ..; pwd`
SUPPORT_DIR="$BUILDPACK_DIR/support"
worker_processes 1;
daemon off;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#!/bin/sh
# bin/release <build-dir>
cat <<EOF
---
config_vars:
PATH: ${HOME}nginx/sbin:/usr/local/bin:/usr/bin:/bin
default_process_types:
web: ./boot.sh
EOF
@danpalmer
danpalmer / install
Last active December 10, 2015 09:28
$ heroku create --stack cedar --buildpack \
https://github.com/danpalmer/heroku-buildpack-hammer.git site-name
$ git push heroku master
...
-----> Downloading Nginx Sources
...
-----> Extracting Nginx Sources
-----> Configuring
...
#import "TestHelper.h"
static int
beforeAllRan
, beforeEachRan
, example1RanCorrectly
, example2RanCorrectly
, afterEachRan
, afterAllRan
;
@danpalmer
danpalmer / gist:4524811
Created January 13, 2013 16:01
OpenSearch link tag for auto discovery.
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
<OpenSearchDescription
xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>GitHub</ShortName>
<Description>Search GitHub</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">
https://github.com/favicon.ico
21
</Image>