Skip to content

Instantly share code, notes, and snippets.

View jedschneider's full-sized avatar

Jed Schneider jedschneider

View GitHub Profile
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

Keybase proof

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:

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:
{

cycling team planning tool

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

  • communicate a point to every one
  • keep it short and on topic
  • identify important dates and times
  • make it consumable by everyone.
# 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
@jedschneider
jedschneider / gist:6113442
Last active December 20, 2015 10:09
Another Take on 'I hated, hated, hated this CoffeeScript'

Another Take on 'I hated, hated, hated this CoffeeScript'

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