Skip to content

Instantly share code, notes, and snippets.

@kahunamoore
kahunamoore / script.js
Created August 18, 2017 06:23 — forked from anonymous/script.js
StudentLookup
// Note: We would normally get this data from
// a database via an HTTP server. This is just
// example data "hard coded" here for clarity.
var alanStudent = {
id: 1234,
firstName: "Alan",
lastName: "Moore",
age: 42,
birthdate: new Date(10, 24, 1964)
@kahunamoore
kahunamoore / index.html
Created August 18, 2017 06:27 — forked from anonymous/index.html
ToDoList
<!-- Note: depends on jQuery being included via Pen Settings -->
<input id="new-todo" type="text" onkeypress="checkForEnter(event);" />
<button onclick="addToDo()" >Add</button>
<button onclick="deleteAll()">Delete All</button>
<ul id="todos"></ul>
@kahunamoore
kahunamoore / index.html
Created August 18, 2017 06:28 — forked from anonymous/index.html
Kqrxae
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script>
<input onkeydown="doit(event)" />
<div id="second-div">Second DIV</div>
<div data="x">Third div</div>
@kahunamoore
kahunamoore / spec_parsing.clj
Created February 19, 2018 08:09 — forked from thegeez/spec_parsing.clj
Parsing with clojure.spec for the Advent of Code challenge
(ns net.thegeez.advent.spec-parsing
(:require [clojure.string :as str]
[clojure.spec :as s]
[clojure.spec.gen :as gen]
[clojure.test.check.generators :as tgen]))
;; Dependencies:
;; [org.clojure/clojure "1.9.0-alpha14"]
;; [org.clojure/test.check "0.9.0"]
;; Advent of Code is a series of code challenges in the form of an advent
@kahunamoore
kahunamoore / ∪_prob.clj
Created March 23, 2018 05:25 — forked from arnaudbos/∪_prob.clj
Inclusion–Exclusion Principle for probabilities in Clojure.
(require '[clojure.math.combinatorics :refer [combinations]])
(defn ∩-prob
[a & more]
(reduce * a more))
(defn ∪-prob [a b & more]
"https://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle#In_probability"
(let [ps (concat [a b] more)
n (count ps)]
@kahunamoore
kahunamoore / cljs-macro.adoc
Created May 7, 2018 21:33 — forked from philoskim/cljs-macro.adoc
How to enumerate the ClojureScript macros

How to enumerate the cljs.core macros in ClojureScript

I wanted to enumerate the macros of cljs.core in ClojureScript. In general, it would not be needed for everyday ClojureScrit programming but I need it to author my debux library.

At first, I asked a question about this problem in Google Clojure Group but got no answers.

I decided to find the way by myself and finally found a way to enumerate the macros of cljs.core in Clojure REPL, so I want to share the exprerience with others here.

The functions of cljs.core are defined in src/main/cljs/cljs/core.cljs and the macros of cljs.core are defined in src/main/clojure/cljs/core.cljc. So you have to evaluate the src/main/clojure/cljs/core.cljc file in Clojure REPL, not in ClojureScript REPL, to get a list of the macros of cljs.core.

@kahunamoore
kahunamoore / alltheflags.md
Created June 5, 2018 07:22 — forked from CodaFi/alltheflags.md
Every Option and Flag /swift (1.2) Accepts Ever

#Every Single Option Under The Sun

  • optimization level options
  • automatic crashing options
  • debug info options
  • swift internal options
  • swift debug/development internal options
  • linker-specific options
  • mode options
@kahunamoore
kahunamoore / trrprefs.md
Created August 8, 2018 14:11 — forked from bagder/trrprefs.md
trr prefs

Preferences

All preferences for the DNS-over-HTTPS functionality in Firefox are located under the "network.trr" prefix (TRR == Trusted Recursive Resolver). The support for these are targeted for shipping in release Firefox 62.

network.trr.mode

set which resolver mode you want.

0 - Off (default). use standard native resolving only (don't use TRR at all)

1 - Race native against TRR. Do them both in parallel and go with the one that returns a result first.