Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@wycats
wycats / freddie7.md
Last active April 8, 2018 02:17
A Response to "The Birthering of the Democrats"

Response to The Birthering of the Democrats

Let us accept from the outset that partisan Democrats and I will never agree on the substance of the particular claims they have made about the election. Let’s simply try to find common ground on what they’re alleging. Conventional post-election debate among Democrats has involved…

Freddie claims that "conventional post-election debate among Democrats" is made up of a number of characteristics. I don't think the debate has been nearly as homogenous as he implies, and the bullets are full of misleading hyperbole that further amps up the emotion of the piece.


@wycats
wycats / errors.md
Last active October 21, 2018 12:04
How I think about error handling in Rust
  • Option: "None is a totally valid result, usually found in data structures"
    • unwrap(): YOLO use in prototyping
    • expect(...): to indicate the reason you believe None is impossible (or a contract violation for the method)
  • Result: 😱 "Errors are unexpected but not bugs; the decision for how to handle them is up to the caller"
    • unwrap(): YOLO "I'm an app and don't know how to handle this error -- I'm fine if the whole process aborts"
    • try! / ?: "Leave the decision about how to handle this error to the caller; they have more information"
    • match / catch: "I'm going to handle the error right here right now"
  • panic!: ☠ "The error is a bug and can't be recovered from. Game over man. Rust is allowed to abort the process if it wants"
poem =
"My honeydew has flown from my hand
And my toast has gone to the
moon.
But when I saw it on television,
Planting our flag on Halley's
comet,
More still did I want to eat it.
"
@wycats
wycats / index.js
Created February 6, 2016 00:57
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
var fs = require("fs");
bash-4.3# ./dev-environment.sh
tune2fs 1.42.13 (17-May-2015)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Creating journal inode: done
which: no distccd in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
distccd pid 25684 port 9256
WARNING: Image format was not specified for 'toolchain.sqf' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
module Mst
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def before(method_name)
m = instance_method(method_name)
define_method method_name do |*args, &block|
@wycats
wycats / getter.js
Last active September 23, 2015 18:15
class Person {
@reader _first, _last;
constructor(first, last) {
this._first = first;
this._last = last;
}
}
class Person {
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});