Skip to content

Instantly share code, notes, and snippets.

@kahunamoore
kahunamoore / week4.md
Created September 19, 2017 07:43
Week #4

Week 4

Client-side JavaScript Frameworks

Monday

Lecture

  • JavaScript review (arrays, objects/maps)
  • Corrections/Ommisions: script end tag required
  • Array.size -> length
@kahunamoore
kahunamoore / week5.md
Created September 19, 2017 07:44
Week #5

Week 5

Server-side JavaScript & Databases

Monday

Lecture

Lab

@kahunamoore
kahunamoore / week6.md
Created September 19, 2017 07:45
Week #6

Week 6

Debugging, Tools and Testing

Monday

Lecture

Lab

@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.

@kahunamoore
kahunamoore / tga.h
Created February 7, 2019 05:31 — forked from maluoi/tga.h
A super short and streamlined C/C++ function for writing .tga images to file! No dependencies, and no cruft.
// Copyright(c) 2019 Nick Klingensmith (@koujaku). All rights reserved.
//
// This work is licensed under the terms of the MIT license.
// For a copy of this license, see < https://opensource.org/licenses/MIT >
#pragma once
#include <stdio.h>
#include <stdint.h>

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg