Skip to content

Instantly share code, notes, and snippets.

View micahwalter's full-sized avatar
👋

Micah Walter micahwalter

👋
View GitHub Profile
@micahwalter
micahwalter / .emacs
Last active February 20, 2016 15:51
emacs4eva
;; micah's .emacs file
;; package manager stuff
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
;; hide menu bar
(menu-bar-mode -1)
;; linum
@micahwalter
micahwalter / ViewController.h
Last active October 1, 2015 20:14
Hello AppleTV
//
// ViewController.h
// Hello AppleTV
//
// Created by Micah Walter on 9/18/15.
//
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
#!/bin/bash
DATESTRING="$(date -I)"
DATADIR="data/"
DATAFILE="${DATESTRING}_objects.csv"
DUMPFILE="${DATADIR}${DATESTRING}_objects.csv"
AWS_ACCESS_KEY="$(cat aws_access_key)"
AWS_SECRET_ACCESS_KEY="$(cat aws_secret_access_key)"
export PGPASSWORD="$(cat redshift_pass)"
/*
Rotary Phone Dial Reader
This sketch reads out the number dialed on a rotary phone dial.
The rotary dial has two signals:
1) turns ON when the wheel is turning
2) pulses a count based on the number dialed.
The results are printed to the serial monitor.
@micahwalter
micahwalter / gists.py
Created June 19, 2015 21:17
gists.py
#!/usr/bin/env python
# Clone or update all a user's gists
# curl -ks https://raw.github.com/gist/5466075/gist-backup.py | USER=fedir python
# USER=fedir python gist-backup.py
import json
import urllib
from subprocess import call
from urllib import urlopen
import os
@micahwalter
micahwalter / post-receive
Created May 14, 2015 11:32
post receive deploy hook
#!/bin/sh
# Check out the code on this server.
GIT_WORK_TREE=/home/git/working/<username>/<projectname> git checkout -f
# Define an array of servers to which the code will be deployed.
SERVERS="abc.example.com, xyz.example.com"
# Push codebase to the servers via rsync.
for SERVER in $SERVERS
@micahwalter
micahwalter / lib_rest.php
Last active August 4, 2020 16:23
library for calling a soap and rest api with php
<?php
loadlib("http");
#################################################################
function rest_call($method, $more=array()){
$defaults = array(
'request_method' => 'GET',
;; fix for php-mode
(require 'cl)
;; package manager stuff
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.milkbox.net/packages/")))
(setq package-enable-at-startup nil)
(package-initialize)
@micahwalter
micahwalter / base58.sql
Created October 7, 2014 22:47
base58.sql
DELIMITER $$
CREATE FUNCTION base58_encode (num bigint(64)) RETURNS varchar(255)
DETERMINISTIC
BEGIN
DECLARE alphabet varchar(255);
DECLARE base_count int DEFAULT 0;
DECLARE encoded varchar(255);
DECLARE divisor DECIMAL(10,4);
@micahwalter
micahwalter / archive_sms.js
Last active August 29, 2015 14:01
archive_sms.js
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
// simple schema for Mongo
var MessageSchema = new Schema({
archived: {
type: Date,
default: Date.now
},
message_id: {