Skip to content

Instantly share code, notes, and snippets.

@nathanallen
nathanallen / live-code-35.rb
Created March 1, 2017 20:37
ruby classes, modules, inheritance
module Moveable
def can_move?
true
end
def accelerate
@speed += 5 # TODO: what is max speed? BUG: What if vehicle isn't on?
end
def brake
@nathanallen
nathanallen / never-graduate.md
Last active November 30, 2016 19:07
I am a developer

Congratulations, you're a Web Developer! You've come a long way, but your journey's only begun! Please take some time to think about the following prompts, and your plan moving forward.

1. What portfolio projects & materials do you need to polish before you can show them to employers? Outline your steps and your timeline.

2. What existing topic areas / technologies do you want to review & solidify?

See Teach Yourself Programming in 10 Years & Programmer Competency Grid.

  • Talking About Code
  • Problem Solving
#!/bin/bash
git filter-branch --env-filter '
if test "$GIT_AUTHOR_EMAIL" = "OLD_EMAIL@old.com"
then
GIT_AUTHOR_EMAIL=new-email@new.com
export GIT_AUTHOR_EMAIL
fi
' -- --all

Week 13 - Final Project / Graduation

Nov 28-30 Monday Tuesday Wednesday Thursday Friday
From b37f800edbdf913280799fd37346c0b75d3fd76d Mon Sep 17 00:00:00 2001
From: nathanallen <thenathanator@gmail.com>
Date: Fri, 2 Sep 2016 11:49:11 -0700
Subject: [PATCH] fix count user posts
---
app/controllers/admin/dashboard_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb
@nathanallen
nathanallen / rails http status codes
Created August 15, 2016 00:44 — forked from seoyoochan/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing

My Coding Roadmap

Best Practices

  • Javascript Style Guide
    • indentation
    • snake_case vs. camelCase

Javascript Standard Library

  • Data Structures
    • Boolean
  • Number
@nathanallen
nathanallen / javascript-character-encodings.js
Last active August 4, 2016 16:39
Javascript Character Codes & Encodings [Script]
// Script to generate list of character codes, characters, and their respective URI/HTML encodings.
/*
* HTML Escape Utility Function
* Adapted from underscore library's _.escape method.
* source: http://underscorejs.org/#escape
*/
var escape = (function() {
@nathanallen
nathanallen / mongoose.md
Last active July 19, 2016 21:49
Cheatsheets

Mongoose Cheatsheet

Schemas

The permitted SchemaTypes are:

  • String
  • Number
  • Date
  • Buffer
@nathanallen
nathanallen / merge-challenge.md
Last active June 21, 2016 22:10
merge challenge

For the following code challenge, you may use any language you wish. You are also free to use google and stack-overflow, although I ask that you include citaitons for any significant work.

Please record your time.

Merge

Write a function merge that takes two objects/hashes as arguments and returns the first object combined with the second object, according to the following rules:

If a key exists in the first object, but not in the second object, the key/value pair should be added ("merged") into the first object.

  • merge( {a: 1}, {b: 2} ) ==> { a: 1, b: 2 }
  • merge( {c: 3}, {d: 4, z: 9} ) ==> { c: 3, d: 4, z: 9 }