Skip to content

Instantly share code, notes, and snippets.

Avatar

Shane Celis shanecelis

View GitHub Profile
@shanecelis
shanecelis / unity-api-lookup.el
Created May 28, 2014
Simple Emacs utility function to lookup Unity API references
View unity-api-lookup.el
;; Simple Emacs utility function to lookup Unity API references by Shane Celis.
(defun unity-api-lookup (string)
"Opens up a browser to Google's first hit for the search string 'unity api reference ' plus your search term."
(interactive (list
(read-string "Look up Unity API reference for: "
(thing-at-point 'word) 'unity-api-lookup-history)))
(browse-url (concat "http://www.google.com/search?btnI&q="
(url-hexify-string
(concat "unity api reference " string)))))
View dired-open-by-macosx.el
(defun dired-open-by-macosx ()
"Opens a file in dired with the Mac OS X command 'open'."
(interactive)
(shell-command (concat "open " (shell-quote-argument (expand-file-name (dired-file-name-at-point))))))
(define-key dired-mode-map (kbd "O") 'dired-open-by-macosx)
View minimap.el
;;; minimap.el --- Sidebar showing a "mini-map" of a buffer
;; Copyright (C) 2009-2014 Free Software Foundation, Inc.
;; Author: David Engster <deng@randomsample.de>
;; Keywords:
;; Version: 1.2
;; This file is part of GNU Emacs.
View keymap_planck_classic.c
#include "keymap_common.h"
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Classic
http://www.keyboard-layout-editor.com/#/layouts/46aa7b0762cb7a535eaaf1e49644398f
*/
/* 0: main layer */
/* XXX Not sure about what goes in the top left and bottom left position: placing ESC and RSFT there for now. */
KEYMAP( ESC, Q, W, E, R, T, Y, U, I, O, P, TAB, \
LCTL, A, S, D, F, G, H, J, K, L, SCLN, BSPC, \
@shanecelis
shanecelis / trie-time.hs
Created Mar 4, 2015
O(M) where M is maximum keystring length
View trie-time.hs
{-# LANGUAGE OverloadedStrings #-}
{- Basic strategy to match patterns that are either '^word$' or
'^word[a-z\']*$': Use two tries.
Case 1 to match '^word$' is covered by constructing a trie and then
running through the data.
Case 2 to match '^word[a-z\']*' is covered by constructing another
trie with the prefix 'word' and then using a regex on the after the
prefix has been found. This code doesn't cover it because of an API
View timelapse
#!/bin/bash
# timelapse
#
# Records a sequence of screencaptures at regular intervals on Mac OS
# X. Can also record using webcam if you have isightcapture
# installed.
#
# http://www.intergalactic.de/pages/iSight.html
#
# Shane Celis
View compete
#!/bin/bash
# compete
if [ $# -eq 0 ]; then
echo "usage: compete <n> <classnames(s)>" >&2;
echo " n number of rounds" >&2;
echo "creates a CSV output for the competition.">&2;
exit 2;
fi
View mycompete
#!/bin/bash
# mycompete
if [ $# -eq 0 ]; then
echo "usage: compete <n> <player1-classname> <player2-classnames(s)>" >&2;
echo " n number of rounds for p1 vs. p2 and p2 vs. p1 (so 2n rounds total)" >&2;
echo "creates a CSV output for the competition.">&2;
exit 2;
fi
View gist:402125
#!/usr/bin/env ruby
# parse-kevin
if ARGV.length != 2 then
puts "usage: parse-kevin <listen-for> <input>"
exit(1)
end
pattern = ARGV[0]
infile = File.new(ARGV[1], "r")
readingRightListen = false
@shanecelis
shanecelis / pastels-on-dark-theme.el
Last active Oct 1, 2015
Pastels on Dark theme for Emacs 24
View pastels-on-dark-theme.el
;;; pastels-on-dark-theme.el --- Pastels on Dark theme for Emacs 24
;; Author: Mats Persson
;; Maintainer: Shane Celis <shane (at) gnufoo (dot) org>
;; URL: http://gist.github.com/1906662
;; Version: 0.3
;; Keywords: theme, color
;;; Commentary: