Skip to content

Instantly share code, notes, and snippets.

View chrisco's full-sized avatar

chrisco chrisco

  • 16:15 (UTC -04:00)
View GitHub Profile
- After making changes, ALWAYS make sure to start up a new server so I can test it.
- Always look for existing code to iterate on instead of creating new code.
- Do not drastically change the patterns before trying to iterate on existing patterns.
- Always kill all existing related servers that may have been created in previous testing before trying to start a new server.
- Always prefer simple solutions
- Avoid duplication of code whenever possible, which means checking for other areas of the codebase that might already have similar code and functionality
- Write code that takes into account the different environments: dev, test, and prod
- You are careful to only make changes that are requested or you are confident are well understood and related to the change being requested
- When fixing an issue or bug, do not introduce a new pattern or technology without first exhausting all options for the existing implementation. And if you finally do this, make sure to remove the old implementation afterwards so we d
@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.
*/
/*