Skip to content

Instantly share code, notes, and snippets.

View micahwalter's full-sized avatar
👋

Micah Walter micahwalter

👋
View GitHub Profile
@dphiffer
dphiffer / vaccine-check.sh
Last active July 25, 2021 05:32
A script that monitors vaccine appointment availability at New York State-run providers.
#!/bin/bash
# see also: https://kvz.io/bash-best-practices.html
set -o errexit
set -o pipefail
set -o nounset
# A script to monitor updates to this web page:
# https://am-i-eligible.covid19vaccine.health.ny.gov/
#
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
/* Basic Digital Read and Rotary Phone Dial Reader
* ------------------
* This code reads whether the phone is on the hook by treating that hook like a button that is either open or depressed
AND it reads out the number dialed on a rotary phone dial by counting the pulses made by the spinning dial wheel.
*/
@peter
peter / gist:9121297
Created February 20, 2014 19:24
Force SSL for Express app on Heroku
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Hooking up the middleware with the express app
// In app.js
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var forceSSL = require('../middleware/ssl').force(config.hostname);
if ('production' == app.get('env')) {
app.use(forceSSL);
}
@desaiashu
desaiashu / app.py
Last active August 15, 2023 18:27
Sample Heroku Flask app with MongoHQ
import os
from urlparse import urlparse
from flask import Flask
from pymongo import MongoClient
MONGO_URL = os.environ.get('MONGOHQ_URL')
if MONGO_URL:
# Get client
client = MongoClient(MONGO_URL)
@naiquevin
naiquevin / mirrors.sh
Created June 16, 2012 08:33
Setting up and maintaining Git repository mirrors
#!/bin/bash
## This shell script will read all names from repos.txt
## which are names of git repositories located at
## git@main-reposerver:/path/to/repos
## if a mirror is not created, it will create
##
## other wise it will try to update the mirror
##
## Main purpose of having mirrors is backup so pushing
@anderssvendal
anderssvendal / Procfile
Created May 3, 2012 13:44
Foreman nginx, php, mysql setup
web: /usr/local/sbin/nginx -p `pwd`/tmp/nginx/ -c ../../nginx.conf
fastcgi: /usr/local/sbin/php-fpm
db: /usr/local/bin/mysqld
@attilaolah
attilaolah / imgcmp.py
Created February 29, 2012 11:30
Fast image comparison with Python
import math
import Image
import Levenshtein
class BWImageCompare(object):
"""Compares two images (b/w)."""
_pixel = 255
@ianoxley
ianoxley / base58.py
Created March 11, 2011 14:00
base58 encoding in Python
""" base58 encoding / decoding functions """
import unittest
alphabet = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'
base_count = len(alphabet)
def encode(num):
""" Returns num in a base58-encoded string """
encode = ''