Skip to content

Instantly share code, notes, and snippets.

View catesandrew's full-sized avatar

Andrew Cates catesandrew

  • Huntington Beach, CA
View GitHub Profile
@DamienCassou
DamienCassou / update-emacs-ppa.sh
Last active February 20, 2016 21:26
Emacs-snapshot and emacs24 build script for Ubuntu PPA
#! /usr/bin/env bash
# Author: Damien Cassou
#
# This is the script I use to build Emacs packages for Ubuntu. These
# packages are uploaded to
# https://launchpad.net/~cassou/+archive/emacs/. Each package is
# either build from a Debian package or from
# http://emacs.naquadah.org/.
@sjl
sjl / kr4mb_math.xml
Created October 2, 2012 23:59
Math Layer
<item>
<name>Math Layer</name>
<appendix>Right Control key activates the Math key layer.</appendix>
<identifier>space_cadet.math_layer</identifier>
<autogen>
--KeyToKey--
KeyCode::CONTROL_R,
KeyCode::VK_STICKY_EXTRA3
#Block the APNIC range of IP addresses - a common source of hacking attempts
sudo ipfw -q add deny src-ip 43.0.0.0/8
sudo ipfw -q add deny src-ip 58.0.0.0/8
sudo ipfw -q add deny src-ip 59.0.0.0/8
sudo ipfw -q add deny src-ip 60.0.0.0/8
sudo ipfw -q add deny src-ip 61.0.0.0/8
sudo ipfw -q add deny src-ip 110.0.0.0/8
sudo ipfw -q add deny src-ip 111.0.0.0/8
sudo ipfw -q add deny src-ip 112.0.0.0/8
@scttnlsn
scttnlsn / debounce.cljs
Created March 24, 2014 17:03
core.async debounce
(defn debounce [in ms]
(let [out (chan)]
(go-loop [last-val nil]
(let [val (if (nil? last-val) (<! in) last-val)
timer (timeout ms)
[new-val ch] (alts! [in timer])]
(condp = ch
timer (do (>! out val) (recur nil))
in (recur new-val))))
out))
# I've always disliked the "./configure" incantation - it's right here! I
# shouldn't need to tell the shell where to look for it. But of course,
# putting '.' in your $PATH is terrible -- it's insecure and throws permission
# errors if you try to 'execute' regular files. Bash 4's `shopt -s autocd`
# solves half the problem; and the ability to override
# command_not_found_handle() solves the other.
#
# This is an OS X-oriented script that attempts to do the most intelligent
# thing possible when you enter the name of a file in your $PWD into the bash
# prompt. It will:
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.