Skip to content

Instantly share code, notes, and snippets.

View coreyti's full-sized avatar

Corey Innis coreyti

  • Mechanical Orchard
  • Portland OR
  • X @coreyti
View GitHub Profile
# my git aliases (incl. printing user.name)
[alias]
who = "!echo ; echo ; echo \"\\tworking as `git config user.name`...\" ; echo ; echo"
what = "!git who ; git diff"
when = "!git who ; git log"
st = "!git who ; git status"
ci = "!git who ; git commit"
co = "!git who ; git checkout"
get = "!git who ; git pull"
put = "!git who ; git push"
@coreyti
coreyti / dsc_convert.sh
Created October 5, 2008 09:25
Converts DSC_NNNN.JPG to something like 2008.Jan.01_NNNN.jpg, where the date prefix is derived from the file modification date
#!/bin/bash
###############################################################################
# Nikon image filename conversion, e.g. (DSC_NNNN.JPG to 2008.Jan.01_NNNN.jpg)
###############################################################################
# change any spaces to underscores
for i in * ; do
if [ -f "$i" ] ; then
echo mv \"$i\" ${i// /_}
def inspect_mate(label="")
puts "#{label} #{yield.inspect.gsub(/</, '&lt;').gsub(/>/, '&gt;')}"
puts "<hr/>"
end
// (maybe) a way to approximate the current "footprint" of
// your javascript (in a firebug-enabled firefox).
//
// example:
// footprint({
// context : 'jQuery',
// initial : true,
// print : true,
// trace : true,
// debug : true,
Happy Birthday Jen!!
@coreyti
coreyti / development.rb
Created October 19, 2010 14:15 — forked from ericallam/gist:251886
NilStore for Rails 3
config.cache_store = :nil_store
@coreyti
coreyti / console.css
Created February 3, 2012 22:16
js & css to send window.console calls to the web page
ul.console {
font-size : 0.85em;
color : #FFF;
text-shadow : 0 1px #000;
position : fixed;
top : 70%;
right : 10px;
z-index : 10000;
width : 200px;
height : 25%;
@coreyti
coreyti / gist:2468664
Created April 23, 2012 03:25
`defined?` as conditional expression in two rubies
# ruby 1.8.7
if defined? THOUGHT ; defined?(self) ; end # returns nil
if defined? THOUGHT && THINK ; defined?(self) ; end # returns nil
if defined?(THOUGHT) && THINK ; defined?(self) ; end # returns nil
if defined?(THOUGHT && THINK) ; defined?(self) ; end # returns nil
defined?(THOUGHT && THINK) # returns nil
@coreyti
coreyti / gist:2789154
Created May 25, 2012 16:49
a simple css-only menubar
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>css-only menu</title>
<style type="text/css" media="screen">
div#page {
margin : 0 auto;
width : 940px;
}
@coreyti
coreyti / grid_and_wells.html
Created May 31, 2012 05:06
Usage Examples from my Fork of Twitter Bootstrap
<section>
<ul>
<li>
<h2>account</h2>
<p>placeholder</p>
</li>
<li>
<h2>balances</h2>
<p>placeholder</p>