Skip to content

Instantly share code, notes, and snippets.

View bobfirestone's full-sized avatar
⛷️
Would rather be skiing

Bob Firestone bobfirestone

⛷️
Would rather be skiing
View GitHub Profile
@bobfirestone
bobfirestone / golfcourse.rb
Created August 9, 2012 18:36
Validating & Testing a MongoDB Array with Rspec and Mongoid
class Golfcourse
include Mongoid::Document
field :name, type: String
field :type, type: String
field :street, type: String
field :city, type: String
field :state, type: String
field :zipcode, type: String
field :phone, type: String
field :loc, type: Array
{
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"font_face": "M+ 1m",
"font_size": 13.0,
"highlight_modified_tabs": true,
"ignored_packages":
[
@bobfirestone
bobfirestone / react-js.md
Last active October 19, 2015 05:48
react.js resources & notes

react.js

bullet point brain dump

  • react is a frontend javascript library created at facebook to simplify the creation of interactive UI components.
  • in the MVC model of the world it is the view layer.
  • one way dataflow to simplify the application logic and better understand what is causing what to happen.
  • paired with the flux libraby for more complex data & interaction models
  • plays nice with frameworks like backbone and angular
  • has serverside rendering to load a page with data & continue updating changes
@bobfirestone
bobfirestone / vim.md
Last active September 24, 2015 18:51
My VIM notes

Why am I learning to use vim?

  • I am tired of buying text editor licenses & having the new version never come out
  • Vim is installed on every *nix computer
  • Vim is free

normal mode

*the repeater all commands can be prepended with a number of times to do the command

  • h = left 1 char
@bobfirestone
bobfirestone / elixir.md
Last active October 4, 2015 05:23
My elixir notes

What is elixir

  • functional programming language
  • data is imutable
  • key philosophy is everything runs around data transformations not mutating and managing state
    • pass returned value from function to function never changing the value of the original input
  • funcitons should take an input & always return the same value like a math formula
  • uses pattern matching for function calling
    • used to assign variables in the function
    • multiple function declerations and determines what version shold get called based on the params matching

Presentation Topic Ideas For DTC Ruby Group

  1. ReactRails
  2. Deep dive into the rails asset pipeline (sprockets & asset compilation)
  3. Setting up your environment (RVM/RBENV, various installer tools)
  4. What are design patterns
  5. Draper & the decorator pattern
  6. Data structures
  7. Blocks & how yield works
  8. Efficient ruby. writing ruby that runs faster
@bobfirestone
bobfirestone / basic-react-component-demo.html
Created March 2, 2017 17:43
This is the html file used to create the examples & code snippets for my presentation on building react.js components to the DTC web & mobile developer group. Presentation given 3/1/17
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Pure React Example</title>
</head>
<body>
<div id="react-container">
<!-- This is the div react is binding to -->
</div>
@bobfirestone
bobfirestone / shapes.erl
Last active March 17, 2017 15:25
Part 1 of my submission for the shapes portion of the 1st assignment of FUNCTIONAL PROGRAMMING IN ERLANG THE UNIVERSITY OF KENT
-module(shapes).
-export([area/1, enclose/1, perimeter/1, tests/0]).
% The area, enclose , and perimeter functions each take a tuple
% formatted {shape, {dimensions}}. The functions pattern match
% against the shape atom and use the dimensions to do the calculations.
% At the bottom of the file there is a test/0 function that
% calls functions to test the math of the various calculations
@bobfirestone
bobfirestone / bits.erl
Created March 17, 2017 15:24
Part 2 of my submission for the shapes portion of the 1st assignment of FUNCTIONAL PROGRAMMING IN ERLANG THE UNIVERSITY OF KENT
-module(bits).
-export([bits/1,tests/0]).
bits(N) when N >= 0 ->
% convert N into a base 2 list then back into a base 10 number
bits(list_to_integer(integer_to_list(N,2)),0).
bits(0, Acc) -> Acc;
bits(N,Acc) ->
@bobfirestone
bobfirestone / two_nine.erl
Created March 20, 2017 21:35
My code for week 2 section 9 of FUNCTIONAL PROGRAMMING IN ERLANG THE UNIVERSITY OF KENT
-module (two_nine).
-export ([double/1,evens/1,median/1,modes/1]).
double([H]) -> [H * 2];
double([H|T]) ->
[H * 2 | double(T)].
evens([H]) when 0 == H rem(2) -> [H];
evens([H|T]) ->