Skip to content

Instantly share code, notes, and snippets.

View etscrivner's full-sized avatar
🦋

Eric Scrivner etscrivner

🦋
View GitHub Profile
-- fxsk
--
-- A simple brainfuck to c++ cross-compiler written in Haskell
module Main where
import System( getArgs )
-- Define types for lexical analyzer
type Token = Char
-- Function: extractToken
///////////////////////////////////////////////////////////////////////////////
// factorial_test.cpp - A simple factorial example
//
// Description:
// Provides a set of unit-tests using Lemon for a simple factorial function.
///////////////////////////////////////////////////////////////////////////////
#include "lemon.h"
///////////////////////////////////////////////////////////////////////////////
// Function: factorial
# Scrape Google News
#
# Grab the top stories from google news and print them
require 'rubygems'
require 'hpricot'
require 'open-uri'
class GoogleNews
def initialize
@url = "http://news.google.com"
# topmovies.rb - Scrape top grossing movies and their ratings from rotten tomatoes
require 'rubygems'
require 'hpricot'
require 'open-uri'
class RottenTomatoes
def initialize
@url = "http://www.rottentomatoes.com"
@hp = Hpricot(open(@url))
end
@etscrivner
etscrivner / .emacs
Created March 28, 2012 01:36
My emacs config
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Emacs Configuration
;; Author: Eric Scrivner
;;
;; Description:
;; My emacs preferences
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'cl)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@etscrivner
etscrivner / python-indenting-fix.el
Created August 1, 2012 03:16
Better indentation in Emacs python-mode
(add-hook 'python-mode-hook
#'(lambda () (setq electric-indent-mode nil)))
@etscrivner
etscrivner / gist:3337235
Created August 13, 2012 05:48
Jump to a file in a new buffer
(defun jump-to-file (file)
"""Opens the given file in the current window if it exists."""
(when (file-exists-p file)
(find-file file)))
(defun jump-to-file-other-window (file)
"""Opens the given file in the window next to the current window"""
(when (file-exists-p file)
(find-file-other-window file)))
git config --global alias.today "log [email protected] --since='12 hours ago' --oneline"
vagrant@precise64:/vagrant$ ltrace ls
__libc_start_main(0x402690, 1, 0x7fffb5a71f28, 0x411700, 0x411790 <unfinished ...>
strrchr("ls", '/') = NULL
setlocale(6, "") = "en_US"
bindtextdomain("coreutils", "/usr/share/locale") = "/usr/share/locale"
textdomain("coreutils") = "coreutils"
__cxa_atexit(0x409fb0, 0, 0, 0x736c6974756572, 3) = 0
isatty(1) = 1
getenv("QUOTING_STYLE") = NULL
getenv("LS_BLOCK_SIZE") = NULL
(defun restore-last-buffer ()
(interactive)
(set-buffer (last-buffer)))
(global-set-key (kbd "<s-wheel-up>") 'bury-buffer)
(global-set-key (kbd "<s-wheel-down>") 'restore-last-buffer)