Skip to content

Instantly share code, notes, and snippets.

View rawsyntax's full-sized avatar

Eric Himmelreich rawsyntax

View GitHub Profile
@rawsyntax
rawsyntax / domaing.rb
Created November 12, 2011 04:13
ruby domain name generator
#!/usr/bin/env ruby
require 'rubygems'
require 'whois'
module Domaing
def self.alliterative?(first_word, second_word)
first_word[0] == second_word[0]
end
def self.generate_names(words)
@rawsyntax
rawsyntax / defuns.el
Last active September 29, 2015 23:08
swap two windows
(require 'cl)
(defun swap-windows ()
"If you have 2 windows, it swaps them."
(interactive)
(cond ((not (= (count-windows) 2))
(message "You need exactly 2 windows to do this."))
(t
(let* ((w1 (first (window-list)))
(w2 (second (window-list)))
➜ ~ gem install heroku
Fetching: heroku-2.4.0.gem (100%)
Successfully installed heroku-2.4.0
1 gem installed
➜ ~ heroku apps:create --stack cedar my-project
Creating my-project... done, stack is cedar
http://my-project.herokuapp.com/ | [email protected]:my-project.git
➜ my-project git:(master) ✗ git push heroku master
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 459 bytes, done.
Total 4 (delta 2), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
@rawsyntax
rawsyntax / magit-commit.diff
Created February 11, 2012 01:13
the commit that broke my arrow key habit
commit 11dce2502c111ff9ae73f95dde89f27d0f84416a
Author: Eric Himmelreich <[email protected]>
Date: Fri Sep 16 10:53:49 2011 -0400
break arrow keys habit, I already know the emacs bindings for moving
Modified eric/bindings.el
diff --git a/eric/bindings.el b/eric/bindings.el
index 9915c7e..bb9d4fc 100644
--- a/eric/bindings.el
(defun scratch-js ()
"Create or switch to a javascript mode scratch buffer"
(interactive)
(if (not (eq nil (get-buffer "scratch-js")))
(switch-to-buffer "scratch-js")
(set-buffer (get-buffer-create "scratch-js"))
(js2-mode)
(switch-to-buffer "scratch-js")))
#!/bin/sh
wget -O - http://someonewhocares.org/hosts/hosts > /tmp/hosts
cat /usr/local/etc/hosts >> /tmp/hosts
cp -av /etc/hosts /etc/hosts.orig
cp -av /tmp/hosts /etc/hosts
@rawsyntax
rawsyntax / js2-mode.el
Created May 31, 2012 21:19
js2-mode with better indentation
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
(add-to-list 'auto-mode-alist '("\\.json$" . js2-mode))
;; Use js-mode indentation in js2-mode, I don't like js2-mode's indentation
;;
;; thanks http://mihai.bazon.net/projects/editing-javascript-with-emacs-js2-mode
;; with my own modifications
;;
(defun my-js2-indent-function ()
@rawsyntax
rawsyntax / defuns.el
Created May 31, 2012 21:25
a scratch buffer for javascript
(defun scratch-js ()
"Create or switch to a javascript mode scratch buffer"
(interactive)
(if (not (eq nil (get-buffer "scratch-js")))
(switch-to-buffer "scratch-js")
(set-buffer (get-buffer-create "scratch-js"))
(js2-mode)
(switch-to-buffer "scratch-js")))