Skip to content

Instantly share code, notes, and snippets.

View jackowayed's full-sized avatar

Daniel Jackoway jackowayed

View GitHub Profile
@ivey
ivey / .emacs
Created October 24, 2008 18:51
(defvar user-temporary-file-directory
(concat temporary-file-directory user-login-name "/"))
(make-directory user-temporary-file-directory t)
(setq backup-by-copying t)
(setq backup-directory-alist
`(("." . ,user-temporary-file-directory)
(,tramp-file-name-regexp nil)))
(setq auto-save-list-file-prefix
(concat user-temporary-file-directory ".auto-saves-"))
@ivey
ivey / tdu
Created March 23, 2009 02:43
du -sk . * | perl -e '$sum=<>;
while (<>) {
($size, $inode)=split;
chop $size;
printf("%30s | %5d | %2.2f%%\n",$inode,$size,$size/$sum*1000);
}' | sort -rn -k 3 | head
;;; open-file-in-github.el --- Open current buffer's file on GitHub
;; Copyright (C) 2009 Michael Ivey & Daniel Jackoway <gweezlebur.com>
;; Version: 0.1.0
;; Keywords: github git open highlight
;; Created: 19 Aug 2009
;; Authors:
;; Michael Ivey
;; Daniel Jackoway

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?

.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');
old code:
code = <<-code
def #{ name }!
initializer = ObjectSpace._id2ref #{ initializer_id }
self.#{ name } = initializer.call(self)
@#{ name }
end
code
compile[code]
@apinstein
apinstein / navigator.geolocation.getAccuratePosition
Created August 5, 2010 19:48
navigator.geolocation.getAccuratePosition
// navigator.geolocation.getAccuratePosition() is an improved version of navigator.geolocation.getCurrentPosition()
//
// getAccuratePosition() is designed and tested for iOS.
//
// The problem with getCurrentPosition() is that it returns an inaccurate position even with "enableHighAccuracy" enabled.
// The problem with watchPosition() is that it calls the success handler every second, and it is resource-intensive.
//
// getAccuratePosition() calls the callback only once, but uses watchLocation() internally to obtain a position that meets your accuracy needs.
// If the timeout is exceeded before a position meeting your accuracy is needed, the best position is returned to the
// success callback, and the error callback does not fire. If you really care about accuracy, you should check it
@wycats
wycats / 0_app.rb
Created April 19, 2012 10:22
Example of using a simple future library for parallel HTTP requests
class TicketsController < ApplicationController
def show
tickets = params[:tickets].split(",")
ticket_data = tickets.map do |ticket|
parallel { Faraday.get("http://tickets.local/#{ticket}") }
end
render json: { tickets: ticket_data.map(&:result) }
end
@grantland
grantland / README.md
Last active June 20, 2024 05:05
NextBus API