View ezducerdemo.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ezducerdemo) | |
;; | |
;; 1st take | |
;; | |
(defn ezducer [constructor] | |
(fn [reducer] | |
(let [steps (fn [a vs] | |
;; Use loop/recur instead of reduce to avoid reduce's |
View functional_interfaces.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import '[java.lang.reflect Method Modifier]) | |
(set! *warn-on-reflection* true) | |
(defn- samsig | |
"Given a SAM interface, returns the j.l.reflect.Method of the abstract method" | |
[sym] | |
(let [kls (resolve sym)] | |
(if (and (class? kls) (.isInterface ^Class kls)) | |
(let [mid (fn [^Method m] [(.getName m) (vec (.getParameterTypes m))]) |
View vendor_asm.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# author Ghadi Shayban <gshayban@gmail.com> | |
set -e | |
if [ -z ${1+x} ] | |
then | |
echo provide an asm git sha / ref | |
exit 1 | |
fi |
View todo.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Do do | |
def dont think, about, it, but, please do | |
[think, about, it, please] | |
end | |
end | |
Do.dont :worry, :about, :grouping, :any, :arguments | |
=> [:worry, :about, :grouping, :arguments] |
View core.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns typehint.core) | |
;; A little type hint hint... | |
(set! *warn-on-reflection* true) | |
;; There are two ways to type hint the return value of a function, but one is | |
;; (technically) wrong: | |
(defn ^String as-string0 |
View strum.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns strum.core | |
(:refer-clojure :exclude [defn]) | |
(:require | |
[clojure.spec :as spec] | |
[clojure.spec.test :as spec.test])) | |
;; --------------------------------------------------------------------- | |
;; Prelude | |
;; HACK: Currently, as of Clojure 1.9.0-alpha14, there is a bug with |
View gist:f57312ff33b799c4c0db56b10e80fe26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dash_id=xxxx | |
api_key=xxx | |
app_key=xxx | |
# 1. export | |
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json | |
# 2. edit dash.json | |
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level |
View blink.cljs.hl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defelem blink | |
[{:keys [interval :as attr] :or {interval 1000}} kids] | |
(with-let [container (span (dissoc attr :interval) kids)] | |
(with-init! | |
(with-interval interval | |
(.toggle (js/jQuery container)))))) |
View README.md
Facebook: Unfollow people and pages
See comments section for more up-to-date versions of the script. The original script is from 2014 and will not work as is.
- Open news feed preferences on your Facebook menu (browser)
- Click people or pages
- Scroll down (or click see more) until your full list is loaded
- Run the script in your browser console
Facebook will block this feature for you while you use it, depending on how much entities you try to unfollow. It automatically unblocks in a couple of hours and you will be able to continue.
NewerOlder