The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.
Add _site
to .gitignore
. The generated site should not be uploaded to Github since its gets generated by github.
The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.
Add _site
to .gitignore
. The generated site should not be uploaded to Github since its gets generated by github.
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 |
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 |
class Mustachio extends Backbone.View | |
render: (template_id, context) -> | |
@templates[template_id].call @, context | |
@prepare = -> | |
templates = {} | |
raw_templates = $('script[type="text/x-handlebars-template"]') | |
raw_templates.each (i, template) -> | |
$template = $(template) |
// Generated by CoffeeScript 1.3.3 | |
utensils.Bindable = (function() { | |
function Bindable(context, dataKey) { | |
if (context == null) { | |
context = $('body'); | |
} | |
this.dataKey = dataKey != null ? dataKey : 'bindable'; | |
this.bindables = $("[data-" + this.dataKey + "]", context); |
window.utensils = {} |