Skip to content

Instantly share code, notes, and snippets.

@emallson
emallson / de-duplicate.el
Created March 6, 2014 01:11
Extension of the Emacs 24.4 function 'delete-duplicate-lines' to 4th, 5th and 6th order arguments.
;; woah! you actually came here! As a reward, I'll let you in on a secret:
;; I'm just making fun of the proliferation of `C-u`'s in the linked post.
;; however, at least the 4th and 6th order de-duplicates are actually feasible.
;; The 4th order one would be some implementation of unit-level code analysis, while
;; the 6th is trivial. You can write that one yourself!
;; for those of you that have no idea what the hell I'm talking about, see here:
;; http://atlanis.net/blog/de-duplicate-el.html
@emallson
emallson / nodejs-repl-eval.el
Created May 30, 2014 02:30
Evaluation functions for the `nodejs-repl' Emacs package.
;;; nodejs-repl-eval.el --- Summary
;;; Commentary:
;;;
;;; Evaluation functions for the `nodejs-repl' package. Written on a stormy
;;; night between days of node hacking.
;;;
;;; Code:
(require 'js2-mode)
(require 'nodejs-repl)
@emallson
emallson / ppm.py
Created November 18, 2014 19:22
Rudimentary NPM-like script for Python (using PIP)
#!/usr/bin/env python3
import json
import argparse
import subprocess
import os
import pip
def find_package_root():
path = os.path.abspath('.')
files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))]

Keybase proof

I hereby claim:

  • I am emallson on github.
  • I am emallson (https://keybase.io/emallson) on keybase.
  • I have a public key whose fingerprint is D39B 20B2 44CD 4B28 CBDA FCDB 5B5F B935 6A03 AA98

To claim this, I am signing this object:

@emallson
emallson / narrow-reindent.el
Last active August 29, 2015 14:21
Defines a minor mode `narrow-reindent-mode` that reindents the region narrowed to after calling `narrow-to-defun`. The region is then indented again after widening the buffer.
;;; narrow-reindent.el
;;;
;;; Summary:
;;;
;;; Defines a minor mode `narrow-reindent-mode' that reindents the region
;;; narrowed to. The region is then indented again after widening the buffer.
;;;
;;; Code:
(defvar-local narrow-reindent--point-min 0)
@emallson
emallson / auto-commit-msg.el
Last active August 29, 2015 14:25
Grab commit messages from whatthecommit.com
;;; -*- lexical-binding: t; -*-
;;; auto-commit-msg.el --- Fetch and insert commit messages.
;;; Commentary:
;; "Generates" commit messages automatically by making a request to `whatthecommit.com'.
;;; Code:
; note: (el-get-install 'request) or (package-install 'request)
@emallson
emallson / collect-timeline.py
Created November 20, 2015 01:55
Iterating over user timelines with Twython
from twython import Twython, TwythonRateLimitError, TwythonError
from glob import glob
from util import sleep_until
from csv import DictReader, DictWriter
import os
APP_KEY = ''
ACCESS_TOKEN = ''
tw = Twython(APP_KEY, access_token=ACCESS_TOKEN)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(require 'ov)
(defcustom symbol-overlay-alist nil
"Alist used to overlay symbols in `symbol-overlay-mode'. Each
key should be a regexp, and each value should be the string to
be displayed in the overlay."
:type 'alist
:group 'symbol-overlay)
(defun symbol-overlay-modification-hook (overlay afterp _beg _end &optional len)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.