Skip to content

Instantly share code, notes, and snippets.

{
"caret_extra_width": 4,
"close_windows_when_empty": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_face": "Hack",
"font_size": 10,
"highlight_line": true,
"ignored_packages":
[
[user]
name = Jason Smith
email = [email protected]
[rerere]
enabled = true
[pack]
threads = 0
[merge]
conflictstyle = diff3
[alias]
source ~/.profile
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Path for RVM
test -d $HOME/.rvm/bin && PATH=$PATH:$HOME/.rvm/bin
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
export PATH=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/local/sbin:/usr/sbin:/Applications/gradle-2.6/bin:$PATH
@smithjason
smithjason / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

#What is RaphaelJS

Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want to create your own specific chart or image crop and rotate widget, for example, you can achieve it simply and easily with this library.

#How to install?

Simply link to the js library via their site or copy/paste it into a local js file for use in your site.

Examples

@smithjason
smithjason / 0.2.1-boggle_class_from_methods.rb
Created February 27, 2014 01:04 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1boggle class challenge
=begin
REFACTOR ON 2/25 AFTER READING 2ND CHAPTER OF "Practical Object Oriented Design in Ruby"
I'm going to attempt to add in an approach that utilizes a Struct for the board so that I can let people
specify rows and columns as they see them using numbers 1-4 instead of 0-3 (so that they're not even
thinking about the underlying multi-dimensional array data structure when making calls to a BoggleBoard
object). This is also an attempt at refactoring so that methods outside of #get_row, #get_col, and #get_coord
don't need to worry about knowing what data structure is used to hold the board information: they can just
request the info they want. According to POODR, this really helps keep the code as changeable as possible
while minimizing the likelihood of a change adversely affecting other areas.
@smithjason
smithjason / 0.2.1-boggle_class_from_methods.rb
Last active August 29, 2015 13:56 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1boggle class challenge
=begin
REFACTOR ON 2/25 AFTER READING 2ND CHAPTER OF "Practical Object Oriented Design in Ruby"
I'm going to attempt to add in an approach that utilizes a Struct for the board so that I can let people
specify rows and columns as they see them using numbers 1-4 instead of 0-3 (so that they're not even
thinking about the underlying multi-dimensional array data structure when making calls to a BoggleBoard
object). This is also an attempt at refactoring so that methods outside of #get_row, #get_col, and #get_coord
don't need to worry about knowing what data structure is used to hold the board information: they can just
request the info they want. According to POODR, this really helps keep the code as changeable as possible
while minimizing the likelihood of a change adversely affecting other areas.
@smithjason
smithjason / 0.2.1-boggle_class_from_methods.rb
Created February 22, 2014 07:53 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1boggle class challenge
=begin
PSEUDOCODE FOR BONUS QUESTION
after going through the exercise and then "f@#! it, it's friday"-ing the bonus, it bugged
me that I did, so I doodled on some paper and found a relationship that I think makes this
bonus question much more approachable:
for any valid diagonal pair of coordinates, the following is true:
- The quotient of (end_coord.first - start_coord.first) and (end_coord.last - start_coord.last) is 1 or -1.
- Therefore, the absolute value of this quotient will always be 1.
- If the value deried from this absolute value quotient is anything except 1, then the pair of coordinates
@smithjason
smithjason / 0.2.1-boggle_class_from_methods.rb
Last active August 29, 2015 13:56 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1boggle class challenge
class BoggleBoard
@@BOARD_LOWERBOUND = 0
@@BOARD_UPPERBOUND = 3
def initialize(board)
@board = board
end
def create_word(*coords)
coords.map { |coord| @board[coord.first][coord.last]}.join("")
SELECT mdate,
team1,
SUM(CASE
WHEN team1=teamid THEN 1
ELSE 0
END) score1,
team2,
SUM(CASE
WHEN team2=teamid THEN 1
ELSE 0