Skip to content

Instantly share code, notes, and snippets.

View lgranger's full-sized avatar

Ray Granger lgranger

View GitHub Profile
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/laurengranger/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME=""

Online Resources

  • Free Code Camp
    • Front End Development Certification
    • Data Visualization Certification
    • Back End Development Certification
  • MOOCs - Harvard et al
    • Focus on CS fundamentals: Algoithyms & Data structures
  • Supliment with Lynda courses or YouTube tutorials free Lynda access through library
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/lgranger/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
@lgranger
lgranger / hcd3.md
Last active February 5, 2016 16:16 — forked from kdefliese/hcd3.md
HighCharts and D3

HighCharts and D3

Overview

HighCharts and D3 are both data visualization tools that you can add to your website.

Highcharts is an open source Javascript library that provides all kinds of different charts you can use. It is supported by all modern browsers (even IE6+!) and mobile browsers. It does not require client-side plugins like Java or Flash. The HighCharts API allows you to update charts at any time after creation, so they can update as frequently as once per second.

See the demo page here. The demo page includes source code for each of the chart types, which is super useful!

{
"pets": {
"dog": {
"id": "515",
"name": "Rusty",
"breed": "ChocolateLabrador"
},
"dog": {
"id": "516",
"name": "Lulu",

When I was learning API's I ran across this error:

ruby/2.2.0/uri/rfc3986_parser.rb:66:in `split': bad URI(is not URI?): (URI::InvalidURIError)

The error came from passing a string with a space in it into string interpolation in an API URI.nThis is was confusing because I had passed in the same string into another API URI and it was fine. When you pass a string "like this" into the query part of the URI then the browser knows what to do. When you pass "like this" into a different part of the string it doesn't know what to do and do it breaks.

WEBrick will do the ruby-string to URI-string conversion for you. To use it require 'WEBrick'and then call WEBrick::HTTPUtils.escape passing in the string you want converted as a parameter.

Here's how I used it in my code:

def watch_two_movies(flight_length, movie_length)
movie_length.sort!
if movie_length[0] + movie_length[1] > flight_length
x = false
end
movie_length.each do |movie|
if movie_length.include?(flight_length - movie)
x = true
end
end
## Proc Examples
# Penny Randomly Barks or Woofs
proc_rand = Proc.new do
if rand(2) == 0
true
else
false
end
<table border="1">
<thead>
<tr>
<th colspan="3">
This is a Regular Table
</th>
</tr>
<tr>
<th>
language
@lgranger
lgranger / DragonClass.rb
Last active October 2, 2015 19:22
Dragon Class & HP Dragon Hash
require "./dragon_species_hashes.rb"
class Dragon
attr_reader :name, :species, :spikes, :scales
def initialize(name, species = :welsh)
species_hash = DRAGON_SPECIES[species]
@name = name.capitalize
@species = species_hash[:name]