Skip to content

Instantly share code, notes, and snippets.

(defun modal-emacs-on () (interactive) (modal-emacs-mode 1))
(defun modal-emacs-off () (interactive) (modal-emacs-mode -1))
(defvar modal--normal-mode-map "The standard keymap that starts everything")
(setq modal--normal-mode-map (make-sparse-keymap))
(define-key modal--normal-mode-map "i" 'modal--insert-mode)
(define-key modal--normal-mode-map "n" 'next-line)
(define-key modal--normal-mode-map "p" 'previous-line)
(define-key modal--normal-mode-map "f" 'forward-char)
(define-key modal--normal-mode-map "b" 'backward-char)
bash-3.2$ irb
irb
1.9.3-p327-falcon :001 > def lol(x=exit); puts hi; end
def lol(x=exit); puts hi; end
=> nil
1.9.3-p327-falcon :002 > def lol(x=exit); puts "hi"; end
def lol(x=exit); puts "hi"; end
=> nil
1.9.3-p327-falcon :003 > lol 10
lol 10
#!/bin/bash
ruby $1
#!/bin/bash
/Applications/Emacs.app/Contents/MacOS/Emacs --debug-init "$@"
;; in my bin home directory
(defun write-file-no-msg (filename)
"write current buffer without causing a message to whatever"
(let ((write-proc (start-process-shell-command "silent-write-file" "*silent-write-file*"
(format "cat > %s" filename))))
(process-send-string write-proc (buffer-string))
(process-send-eof write-proc)))
require File.expand_path('./interactions.rb', File.dirname(__FILE__))
module Interactions
class EventList < Interaction
def event_on_page? artist, venue, date=nil
event_on_page_all? [artist, venue, date].reject
end
def event_on_page_all? all_content
with_cuke do
@joelmccracken
joelmccracken / gist:3315602
Created August 10, 2012 16:56
generating data for cucumber tests
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(progn
(let* ((artists '( "Enterprise Baroque Ensemble"
"Engineering Flute Quartet"
))
`which ruby`
#see
@joelmccracken
joelmccracken / hack.sh
Created April 4, 2012 03:53 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
(defun insert-literate-funnes (ch)
(interactive)
(goto-char (point-min))
(insert ">")
(while (< (forward-line 1) 1)
(insert ">")))
;;