Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
#
# greps the latest version of each gem for def, class, module and constants
# assumes you have a tmp dir under your home dir
# you can then grep this file in emacs for definitions and then you can click
# on them to go to the file
#
last=[]
results=Gem.path.map do |dir|
Dir["#{dir}/gems/*-[0-9].[0-9]*/lib"].sort{|a,b|b<=>a}.reject do |gem|
@jacott
jacott / single_thread_helper.rb
Created June 3, 2012 10:32
Single threading Capybara/Selenium for using transactional fixtures
require 'thread'
class MyBlockCaller
def initialize
@block = nil
@lock = Mutex.new
@result = nil
@call_done = ConditionVariable.new
@ready_to_call = ConditionVariable.new
@jacott
jacott / update-visited-file-modtime-if-unchanged.el
Created July 28, 2012 00:01
Fix Emacs thinking a file has changed when its contents haven't only its modification time. Useful when using git checkout
(defun update-visited-file-modtime-if-unchanged ()
"Check the contents of all file buffers with changed file-modtime to see if they have really changed.
If not `set-visited-file-modtime' to match file."
(interactive)
(with-temp-buffer
(buffer-disable-undo)
(let (buf
fn
(cbuf (current-buffer))
(buffers (buffer-list)))
@jacott
jacott / handlebars-sgml-hacks.el
Last active December 15, 2015 15:39
Emacs sgml-mode (html-mode) hack to support handlebars templating
;;;
;;; handlebars-sgml-hacks.el --- add Handlebars contextual indenting support to sgml-mode
;;;
;;; Initial Developer: Geoff Jacobsen <geoffjacobsen@gmail.com>, 2013
;; Original code belongs to the Free Software Foundation
;; (see sgml-mode.el in GNU Emacs)
;; This file is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@jacott
jacott / heatmap-using-inverse-distance-weighting-shepard-s-method.markdown
Created January 12, 2019 21:41
Heatmap using Inverse distance weighting - Shepard's method