This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
/* | |
This snippet is an example of backpressure implementation in Go. | |
It doesn't run in Go Playground, because it starts an HTTP Server. | |
The example starts an HTTP server and sends multiple requests to it. The server starts denying | |
requests by replying an "X" (i.e. a 502) when its buffered channel reaches capacity. | |
This is not the same as rate-limiting; you might be interested in https://github.com/juju/ratelimit | |
or https://godoc.org/golang.org/x/time/rate. |
package main | |
import ( | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
var ( |
(defn invoke-private-method [obj fn-name-string & args] | |
(let [m (first (filter (fn [x] (.. x getName (equals fn-name-string))) | |
(.. obj getClass getDeclaredMethods)))] | |
(. m (setAccessible true)) | |
(. m (invoke obj args)))) | |
(defn private-field [obj fn-name-string] | |
(let [m (.. obj getClass (getDeclaredField fn-name-string))] | |
(. m (setAccessible true)) | |
(. m (get obj)))) |
# /usr/libexec/java_home -X | |
$ sudo opensnoop -n java_home | |
UID PID COMM FD PATH | |
501 79809 java_home 3 /System/Library/PrivateFrameworks/JavaLaunching.framework/Versions/A/JavaLaunching | |
501 79809 java_home 3 /dev/dtracehelper | |
501 79809 java_home 4 /System/Library/CoreServices/SystemVersion.bundle//English.lproj | |
501 79809 java_home -1 /System/Library/CoreServices/SystemVersion.bundle//Base.lproj | |
501 79809 java_home 4 /System/Library/CoreServices/SystemVersion.bundle/English.lproj/SystemVersion.strings | |
501 79809 java_home -1 /System/Library/CoreServices/SystemVersion.bundle/English.lproj/SystemVersion.stringsdict | |
501 79809 java_home 3 /usr/share/icu/icudt51l.dat |
;;; http://srfi.schemers.org/srfi-26/srfi-26.html | |
(defn ^:private cut* | |
[[a f] form] | |
(cond | |
(nil? form) [a f] | |
(seq? (first form)) | |
(let [[arg-list xform] (cut* [[] '()] (first form))] | |
(recur [(reduce conj a arg-list) (concat f (list xform))] (next form))) |
(defmacro def-curry-fn [name args & body] | |
{:pre [(not-any? #{'&} args)]} | |
(if (empty? args) | |
`(defn ~name ~args ~@body) | |
(let [rec-funcs (reduce (fn [l v] | |
`(letfn [(helper# | |
([] helper#) | |
([x#] (let [~v x#] ~l)) | |
([x# & rest#] (let [~v x#] | |
(apply (helper# x#) rest#))))] |
function cons(x, y) { | |
return function(w) { return w(x, y) }; | |
}; | |
function car(z) { | |
return z(function(x, y) { return x }); | |
}; | |
function cdr(z) { | |
return z(function(x, y) { return y }); |
This is a full set of key bindings (as of Vimium v1.45); covering all Vimium functionality. I have tried to map all Vimium functionality to comparable Emacs functionality (whenever possible). In cases where there is no equivalent, those commands are prefixed by <c-g>
(indicating <c-g>
oogle Chrome; and because <c-g>
does not conflict with other Emacs shortcuts at all).
Commented Shortcuts: There are a few Emacs-style shortcuts that are simply not possible in Vimium. All of my shortcuts (including those which were not possible; i.e. where I used a decent alternative) have been commented below. This should help to clarify my rationale.
_Compatibility: All of these shortcuts were tested on Mac OS X (Mavericks). Please note that all of my shortcuts operate under the assumption that your Emacs Meta key is the ⌥
Alt/Option key. This really was my only choice, because the ⌘
key is already used in Chrome for shortcuts that c
(defvar helm-fzf-source | |
(helm-build-async-source "fzf" | |
:candidates-process 'helm-fzf--do-candidate-process | |
:nohighlight t | |
:requires-pattern 2 | |
:candidate-number-limit 9999)) | |
(defun helm-fzf--do-candidate-process () | |
(let* ((cmd-args `("fzf" "-x" "-f" ,helm-pattern)) | |
(proc (apply #'start-file-process "helm-fzf" nil cmd-args))) |