Skip to content

Instantly share code, notes, and snippets.

View bsima's full-sized avatar
drinking coffee

Ben Sima bsima

drinking coffee
View GitHub Profile
title
Git Good

This is a starting point for mastering git, a sisyphean task no doubt. Git is a complex software, nobody is expected to master all of it, so if you have a useful tip, please share!

The git manual pages are actually very good. Start with man git and maybe check out man gittutorial. Don't be shy about using `man

Get started:

  1. Install Leiningen
  2. Run lein new repl-sesh, then cd repl-sesh
  3. Open project.clj and change the clojure version to [org.clojure/clojure "1.9.0-alpha14"]
  4. lein repl and awaaaayy we go!

Resources

name: api
version: 0.1.0.0
synopsis: Initial project template from stack
description: Please see README.md
homepage: https://github.com/githubuser/api#readme
license: BSD3
license-file: LICENSE
author: Author name here
maintainer: example@example.com
copyright: 2016 Author name here
module Main exposing (..)
import Html as Html
import State as State
import Types as Types
import View as View
init = ("hi", Cmd.none)
view model = Html.h1 [] [Html.text model]
@bsima
bsima / elm-error.md
Last active November 17, 2016 22:21

The app works with elm make Main.elm --output index.html, but elm reactor just shows a blank page with the error:

Uncaught TypeError: Cannot read property 'nativeBinding' of undefined
Uncaught TypeError: runElmProgram is not a function

The code

Types.elm

"Given this background, it was not in the least surprising that to Plessner,
philosophical anthropology – first and foremost – had a practical aim. In 1936,
he gave an address on the task of philosophical anthropology in which he argued
that the degeneration of the classical and Christian legacies had created a
cultural void which fundamentally threatened the essence of humankind. The task
of philosophical anthropology is to remind people of their possibilities, hidden
in 'the shadow of tomorrow.'"
Page 13: http://www.aup.nl/wosmedia/2055/plessners_philosophical_anthropology_sample.pdf
user> (spec/exercise string?)
(["" ""] ["" ""] ["Xh" "Xh"] ["oi8" "oi8"] ["Im2" "Im2"] ["7wA" "7wA"] ["" ""] ["q" "q"] ["pm1o" "pm1o"] ["01O" "01O"])
user> (spec/exercise uuid?)
([#uuid "5c8f5e30-508e-4647-ae69-5f3861094549" #uuid "5c8f5e30-508e-4647-ae69-5f3861094549"] [#uuid "62fb51af-f75b-482c-afe9-0877aa7cf18e" #uuid "62fb51af-f75b-482c-afe9-0877aa7cf18e"] [#uuid "0a5a7b74-fad8-4b19-9866-9e62beade1f0" #uuid "0a5a7b74-fad8-4b19-9866-9e62beade1f0"] [#uuid "2bb183b6-e80c-41b4-9d4e-f878eb10b79a" #uuid "2bb183b6-e80c-41b4-9d4e-f878eb10b79a"] [#uuid "bf0c6006-9742-40e5-b704-c81502b0a6fe" #uuid "bf0c6006-9742-40e5-b704-c81502b0a6fe"] [#uuid "138bda25-4ffd-4f99-9140-551dde5a460d" #uuid "138bda25-4ffd-4f99-9140-551dde5a460d"] [#uuid "8678fedf-4239-443a-a5e9-4563b90204ac" #uuid "8678fedf-4239-443a-a5e9-4563b90204ac"] [#uuid "8dcb7b8c-985a-4834-87ea-68cf78b597d7" #uuid "8dcb7b8c-985a-4834-87ea-68cf78b597d7"] [#uuid "ed80358f-4d6d-426e-be72-2f81768dfb2a" #uuid "ed80358f-4d6d-426e-be72-2f81768dfb2a"] [#uuid "57691803-
error: mismatched types [--explain E0308]
--> <anon>:4:5
4 |> string.push_str(segment)
|> ^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found ()
note: expected type `std::string::String`
note: found type `()`
error: aborting due to previous error
playpen: application terminated with error code 101
int pure_random(int seed) {
return 22 * seed % 37;
}
/* example usage */
int fst = pure_random(1);
int snd = pure_random(fst);
int thr = pure_random(snd);
-- http://www.parsonsmatt.org/2016/02/27/an_elegant_fizzbuzz.html
import Data.Foldable
import Data.Maybe
type FizzRule = Integer -> Maybe String
rule :: Integer -> String -> FizzRule
rule n m i =
case i `mod` n of