Skip to content

Instantly share code, notes, and snippets.

Michael Kaiser-Nyman michaelrkn

View GitHub Profile
View ember-roadmap-2018.md

Address the Hierarchy of Skepticism

Like most Ember developers, I want to see Ember's marketshare and mindshare grow in 2018. At EmberConf 2017, Tom presented the Ember Hierarchy of Skepticism:

  1. Metamorph Tags/ {{bindAttr}} (addressed!)
  2. No Documentation (addressed!)
  3. Custom Object Model
  4. Big File Size
  5. Monolothic
View Forecaster.java
package com.example.michael.forecaster;
import com.squareup.okhttp.Call;
import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
public class Forecaster {
public void fetchForecast(int zip, Callback callback) {
@michaelrkn
michaelrkn / if.rb
Last active Aug 29, 2015
implement if, then, and else as methods
View if.rb
class Object
def _if(object)
object.class != FalseClass && !object.nil?
end
end
class TrueClass
def then
yield
self
View end_of_day_cleanup.sh
killall Terminal Google\ Chrome Sublime\ Text\ 2 Remote\ Desktop\ Message Finder
cd ~
find . ! -name .rubies ! -name .gem ! -name .Trash ! -name Code ! -name Desktop ! -name Documents ! -name Downloads ! -name Library ! -name Movies ! -name Music ! -name Pictures ! -name Public -maxdepth 1 -type d -print | xargs rm -rf
rm -rf ~/Code/* ~/Desktop/* ~/Documents/* ~/Downloads/* ~/Movies/* ~/Pictures/* ~/Public/*
rm ~/*
View config.ru
require "action_controller/railtie"
class TheSimplestRailsApp < Rails::Application
config.secret_token = "ef224177dc6ddcaabffafdbaa50cdb173eb744932073d"
config.eager_load = false
initialize!
routes.draw do
root to: "hello#world"
end
@michaelrkn
michaelrkn / say_smaller.rb
Created Sep 3, 2013
a simple example of recursion
View say_smaller.rb
def say_smaller(word)
if word.length > 0
word + " " + say_smaller(word[0..-2])
else
""
end
end
puts say_smaller("piglet")
View factorial.rb
def factorial(number)
(1..number).inject(&:*) || 1
end
@michaelrkn
michaelrkn / spacing.js
Created Aug 10, 2013
epicodus javascript spacing guide
View spacing.js
// include a space after most keywords (eg var, if, else, for, return)
var foo = "bar";
// include a space around operators
foo === "bar";
foo += "qux";
// put a space after most closing parentheses
// indent within if statements
View js-cheat-sheet.js
// VARIABLES
// assign a variable to something - use the `var` keyword
var myVariable = "i love variables";
// change the value of an existing variable - don't use `var`
myVariable = "i REALLY love variables";
// change the value of a variable in place
myVariable = myVariable + " - don't you?";
@michaelrkn
michaelrkn / scripts.js
Last active Jan 10, 2019
JavaScript for Pig Dice
View scripts.js
var Player = {
setNumber: function(number) {
this.number = number;
},
addPoints: function(points) {
this.score += points;
},
score: 0
};
You can’t perform that action at this time.