Skip to content

Instantly share code, notes, and snippets.

View michaelsbradleyjr's full-sized avatar
💭
Dip trip, flip fantasia 🎺

Michael Bradley michaelsbradleyjr

💭
Dip trip, flip fantasia 🎺
View GitHub Profile
@swannodette
swannodette / gist:4254233
Created December 10, 2012 23:15
cljs-repl.el
(defun browser-repl ()
(interactive)
(run-lisp "/usr/local/bin/lein trampoline cljsbuild repl-listen"))
(defun repljs ()
(interactive)
(run-lisp "~/Dropbox/development/clojure/clojurescript/script/repljs"))
@creationix
creationix / test.js
Last active December 10, 2015 11:49
Example usage of runonce
var runOnce = require('uvrun').runOnce;
// Do something here, like make a server to keep the event loop busy
var TCP = process.binding('tcp_wrap').TCP;
var server = new TCP();
server.onconnection = function () {
console.log("connection!");
};
server.bind("0.0.0.0", 3000);
server.listen(511);
@Bpless
Bpless / shell_plus_reloader.py
Last active June 5, 2018 11:40
Shell_Plus reloader thread
class ReloaderEventHandler(FileSystemEventHandler):
"""
Listen for changes to modules within the Django project
On change, reload the module in the Python Shell
Custom logic required to reload django models.py modules
Due to the singleton AppCache, which caches model references.
For those models files, we must clear and repopulate the AppCache
"""
def __init__(self, *args, **kwargs):
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 28, 2025 00:02
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@paulirish
paulirish / performance.now()-polyfill.js
Last active December 11, 2024 09:06
performance.now() polyfill (aka perf.now())
// @license http://opensource.org/licenses/MIT
// copyright Paul Irish 2015
// Date.now() is supported everywhere except IE8. For IE8 we use the Date.now polyfill
// github.com/Financial-Times/polyfill-service/blob/master/polyfills/Date.now/polyfill.js
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed
@michaelsbradleyjr
michaelsbradleyjr / yin-yang.js
Last active December 17, 2015 18:48
The "yin-yang" call/cc puzzle ported from Scheme to JavaScript per jonas.
// jonas :: https://github.com/michaelsbradleyjr/jonas
// :: https://npmjs.org/package/jonas
var jonas = require("jonas"),
Cont = jonas.Monad.Cont,
pCont = jonas.Monad.pCont,
Q = jonas.Q,
util = require("util");
@willurd
willurd / web-servers.md
Last active May 18, 2025 17:06
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Chouser
Chouser / externs_for_cljs.clj
Created June 17, 2013 13:44
Generate an externs.js file for arbitrary JS libraries for use in advanced Google Closure compilation, based on the ClojureScript code that uses the libraries.
(ns n01se.externs-for-cljs
(:require [clojure.java.io :as io]
[cljs.compiler :as comp]
[cljs.analyzer :as ana]))
(defn read-file [file]
(let [eof (Object.)]
(with-open [stream (clojure.lang.LineNumberingPushbackReader. (io/reader file))]
(vec (take-while #(not= % eof)
(repeatedly #(read stream false eof)))))))
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 5, 2025 13:05
A badass list of frontend development resources I collected over time.
@honza
honza / gist.md
Created June 30, 2013 23:03
Clojure vs Haskell

Haskell vs Clojure

The JSON data is in the following format

{
    "Genesis": {
        "1": {
            "1": "In the beginning..." ,
            "2": "..."