Skip to content

Instantly share code, notes, and snippets.

View chrisco's full-sized avatar

Christopher Comella chrisco

View GitHub Profile
@maker-leo
maker-leo / Preferences.sublime-settings
Last active December 14, 2015 19:19 — forked from leoallen85/Preferences.sublime-settings
Suggested settings for your Preferences.sublime-settings.
{
// This is the ruby default
"tab_size": 2,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true,
// This shows all your whitespace, including spaces and tabs
// helps keep code clean and properly indented!
"draw_white_space": "all",
@headius
headius / gist:1234935
Created September 22, 2011 14:38
OS X 'pickjdk' command with single-command selection and updated JDK location
#!/bin/bash
#
# Provides a function that allows you to choose a JDK. Just set the environment
# variable JDKS_ROOT to the directory containing multiple versions of the JDK
# and the function will prompt you to select one. JAVA_HOME and PATH will be cleaned
# up and set appropriately.
_macosx()
{
if [ $(uname -s) = Darwin ]; then
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@alandipert
alandipert / isbn13.clj
Created August 27, 2011 18:11
ISBN-13 validation
(defn isbn13? [isbn13]
(let [nums (map #(Integer/parseInt %) (re-seq #"\d" isbn13))
first-nums (butlast nums)
sum (->> first-nums
(map vector (cycle [1 3]))
(map (partial apply *))
(reduce +))
last-num (last nums)]
(= last-num
(- 10 (mod sum 10)))))
/*
* Added additional null checks when closing the ResultSet and Statements.
*
* Thanks to pihug12 and Grzegorz Oledzki at stackoverflow.com
* http://stackoverflow.com/questions/5332149/jdbc-scriptrunner-java-lang-nullpointerexception?tab=active#tab-top
*/
/*
* Modified: Use logWriter in print(Object), JavaDoc comments, correct Typo.
*/
/*