Skip to content

Instantly share code, notes, and snippets.

@f3r
f3r / gemfile.rb
Last active August 29, 2015 14:07
Sample WDI Development Gemfile
group :development do
# Spring speeds up development by keeping your application running in the background.
#> https://github.com/rails/spring
gem 'spring'
# Better Errors replaces the standard Rails error page with a much better and more useful error page.
#> https://github.com/charliesome/better_errors
gem 'better_errors'
gem 'binding_of_caller' # adding REPL
@f3r
f3r / places_show.js.coffee
Last active August 29, 2015 14:08
Best practices on how to organize your coffeescript files in rails
# .../app/assets/javascripts/places_show.js.coffee
PlaceShow =
initialize: (opts) ->
#*******************************************************************************************
# INITIALIZERS
#*******************************************************************************************
isCalendarOpen = false
@.initializePanoramas()
@.initializeSlider()
@.initializeSharePlace(opts.share_title, opts.share_url, opts.share_id)
@f3r
f3r / return.js
Created November 2, 2014 23:25
5-min Quiz - Javascript return
///
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return
//
// $ brew update && install node
// $ node return.js
//
var print = function(t){ console.log(t) };
var counter = function() {
@f3r
f3r / bmi.coffee
Created November 15, 2014 10:48
bmi calculator
cal_bmi = (weight_kg, height_cm) ->
height_m = height_cm/100
bmi = weight_kg / (height_m * height_m)
f_bmi = Math.floor(bmi)
diff = Math.round((bmi - f_bmi) * 10)
if diff == 10 # Need to bump up the whole thing instead
f_bmi += 1
diff = 0
@f3r
f3r / apis.md
Last active August 29, 2015 14:10
APIs Intro
@f3r
f3r / bindingBehaviour.js
Last active August 29, 2015 14:15
Binding Behaviour quiz :)
loggest('Let\'s get the party STARTED');
function loggest(txt){
var length = (txt.length + 2);
if (length > 80) { length = 80 };
console.log(txt); console.log(new Array(length + 2).join('-'));
}
function bindBehavior(config) {
@f3r
f3r / areYouAnObject.js
Created February 12, 2015 11:41
Everything is an object!
var stuff = [42, "forty-two", [], {}, (function(){}) ];
var isAnObject = false;
for(var i=0; i < stuff.length; i++) {
isAnObject = stuff[i] instanceof Object;
console.log(stuff[i].constructor + ' instanceof Object? ' + isAnObject);
}
@f3r
f3r / standup.md
Created April 8, 2015 03:25
WDI-HK-7::MorningStandup
______________$$$$$____________________________________________________ WDI 7 - Hong Kong
__$$$$_______$$$___$$$$$______________________________________________ Tue, March 31 2015
_$$$$$$_____$$$___$$$$$$$________________________________________________________________
$$$_$$$$___$$$__$$$$____$________________________________________________________________
$____$$$$_$$$$_$$$_______________________________________________________________________
_______$$$$$$$$$$___$$$$$________________________________________________________________
____$$$$$$$$$$$$_$$$$_$$$$$______________________________________________________________
___$$$$$$$$$$$$$$$$$_____$$$_____________________________________________________________
__$$$__$$$$$$$$$$$$________$_____________________________________________________________
@f3r
f3r / HackerMission.md
Created April 8, 2015 03:29
WDI-HK-7::HackerMission

Mission Brief

Morning 007s.

Your mission, should you choose to accept it, is to identify and eliminate the hacker who breached our secure data centers.

All the identities of your fellow WDI agents will be open and they will all be in great danger if we don't react fast.

Our security records indicate this following log access to the servers

@f3r
f3r / HackerMission-Solution.md
Last active August 29, 2015 14:18
WDI-HK-7::HackerMission-Solution

Here is the Student Asessment

Mission Brief

Morning 007s.

Your mission, should you choose to accept it, is to identify and eliminate the hacker who breached our secure data centers.