Skip to content

Instantly share code, notes, and snippets.


Eric Scrivner etscrivner

Block or report user

Report or block etscrivner

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fxsk.hs
-- 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
View factorial_example.cpp
// 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
View topnews.rb
# 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 = ""
View topmovies.rb
# topmovies.rb - Scrape top grossing movies and their ratings from rotten tomatoes
require 'rubygems'
require 'hpricot'
require 'open-uri'
class RottenTomatoes
def initialize
@url = ""
@hp = Hpricot(open(@url))
etscrivner / .emacs
Created Mar 28, 2012
My emacs config
View .emacs
;; Emacs Configuration
;; Author: Eric Scrivner
;; Description:
;; My emacs preferences
(require 'cl)
etscrivner / python-indenting-fix.el
Created Aug 1, 2012
Better indentation in Emacs python-mode
View python-indenting-fix.el
(add-hook 'python-mode-hook
#'(lambda () (setq electric-indent-mode nil)))
etscrivner / gist:3337235
Created Aug 13, 2012
Jump to a file in a new buffer
View gist:3337235
(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)))
View gist:3372223
git config --global "log --since='12 hours ago' --oneline"
View gist:4694677
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("LS_BLOCK_SIZE") = NULL
View gist:5390062
(defun restore-last-buffer ()
(set-buffer (last-buffer)))
(global-set-key (kbd "<s-wheel-up>") 'bury-buffer)
(global-set-key (kbd "<s-wheel-down>") 'restore-last-buffer)
You can’t perform that action at this time.