Skip to content

Instantly share code, notes, and snippets.

@natekandler
natekandler / boggle_board_class.rb
Last active August 29, 2015 13:55 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
Creating a Boggle Board Class
dice_grid = [["b", "r", "a", "e"],
["i", "o", "d", "t"],
["e", "c", "l", "r"],
["t", "a", "k", "e"]]
class BoggleBoard
def initialize(board)
@board = board
end
var counter1 = 0
var counter2 = 0
$(document).ready(function(){
var $player1 = $("#player1_strip");
var $player2 = $("#player2_strip");
$(document).keyup(function(event){
// event.which for keyup will return the ascii value for the key that was pressed
if (event.which === 80){
@natekandler
natekandler / rake_yolo.rb
Created May 15, 2014 19:28
rake db:YOLO!
# put in rakefile under - namespace :db
# also in namespace :db, make sure create and drop end with system rather than exec
desc "Drop Create and Migrate yo DB"
task :yolo => ["db:drop", "db:create", "db:migrate"]
" Sampled from Gary Bernhardt's .vimrc file
" vim:set ts=2 sts=2 sw=2 expandtab:
execute pathogen#infect()
syntax on
filetype plugin indent on
set shortmess=a
set cmdheight=2
Tiffany - There is a Sinatra skeleton in the cohort repos, don't use JQuery CDN version 3.
Matt - Helpers directory needs to be directly under app
David - Status code of 200 will always send back string
Jordan - ES2015 has an arrow function
Erik - In JS you can pass an object literal as an argument to a function
Ali - You can store a partial as a variable convert to json and send it with json data
Jack - You can use modules instead of helper methods
Ian - Weirdness with params in authentication?
Brendan - .off in JQuery will remove event binding, not all JS versions support default arguments
Lisa - JQuery script needs to be added before your other JS
" vim:set ts=2 sts=2 sw=2 expandtab:
execute pathogen#infect()
syntax on
filetype plugin indent on
set shortmess=a
set cmdheight=2
set noerrorbells visualbell t_vb=
// In the homePageModule
// homePage/actionTypes.js
export const HOMEPAGE_ACTION = 'homePage/HOMEPAGE_ACTION';
// homePage/actions.js
export const homePageAction = (data) => {
return {
type: actionTypes.HOMEPAGE_ACTION,
payload: data