I hereby claim:
- I am jedschneider on github.
- I am jedschneider (https://keybase.io/jedschneider) on keybase.
- I have a public key whose fingerprint is C737 E899 0432 C09A 589F 3E7A 4790 6901 0131 543C
To claim this, I am signing this object:
module Main exposing (..) | |
import Html exposing (..) | |
import Html.App as Html | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (onInput, onClick) | |
import String exposing (..) | |
import Char | |
import Maybe |
import Html exposing (..) | |
import Html.App as Html | |
import Html.Attributes exposing (..) | |
import Html.Events exposing (onInput) | |
import String exposing (..) | |
import Char | |
main = | |
Html.beginnerProgram |
class InsertionSort | |
def initialize(list) | |
@list = list | |
@sorted = [] | |
end | |
def sort | |
insert(@list.shift) while @list.length > 0 | |
@sorted | |
end |
I hereby claim:
To claim this, I am signing this object:
var Storage = (function() { | |
var uniqueId = 0; | |
function Storage() {} | |
Storage.prototype.add = function(item) { | |
var id = this.generateId() | |
, data = this._toJSON(item); | |
localStorage[id] = data; | |
}; |
# valid | |
{event: {which: 13, target: {value: "test"}}} | |
#valid | |
{ | |
event: | |
{ | |
which: 13, | |
target: | |
{ |
so it seems like there might space for a product that makes team communication easier. not like that is an underserved product category out there but still, i'm struggling to find a tool that makes it easy for users to
# original solution in ruby tapas 150 | |
class Median | |
def self.avdi(list) | |
sorted = list.sort | |
q, r = sorted.size.divmod(2) | |
middle = sorted[q - 1 + r, 2 - r] | |
middle.reduce(:+) / middle.size | |
end |
As a follow up to both the initial article and the followup, I wanted to give my own take on 'idiomatic CoffeeScript' as I see it. I'm a huge fan of Reggie's work and highly reccomend his books on CoffeeScript and JavaScript.
I like CoffeeScript's class
syntax, I admit it. Not because I love OOP or think that we should necessarily think in in OOP concepts, but because it provides a clean functional interface for thinking in domain concepts. Classes in CoffeeScript are not classes, they are function wrappers with their own environments. If you want to think of them as classes, have at it, I won't blame you.
To review for Reggie's article, lets look at his concept of idiomatic CoffeeScript.
table = (numberO
class Page | |
require 'uri' | |
require 'json' | |
require 'net/http' | |
require 'net/https' | |
def initialize(name, markup, css) | |
@name = name | |
@markup = markup | |
@css = css |