Skip to content

Instantly share code, notes, and snippets.

@granella
granella / generate-certificate-chain.sh
Created June 27, 2016 11:15
Create self-signed certificate with root and ca for development
#!/bin/bash
rm *.jks 2> /dev/null
rm *.pem 2> /dev/null
echo "===================================================="
echo "Creating fake third-party chain root -> ca"
echo "===================================================="
# generate private keys (for root and ca)
@paf31
paf31 / 24days.md
Last active August 8, 2023 05:53
24 Days of PureScript

This blog post series has moved here.

You might also be interested in the 2016 version.

@puffnfresh
puffnfresh / do.sjs
Created October 4, 2012 04:40
do-notation using sweet.js
macro $do {
case { $y:expr } => {
$y
}
case { $x:ident <- $y:expr $rest ... } => {
λ['>=']($y, function($x) {
return $do { $rest ... }
});
}
}
@mfikes
mfikes / README.md
Last active March 8, 2019 12:11
cljs.main rebel-readline

Start cljs.main with rebel-readline:

clojure -Sdeps '{:deps {github-mfikes/cljs-main-rebel-readline {:git/url "https://gist.github.com/mfikes/9f13a8e3766d51dcacd352ad9e7b3d1f" :sha "27b82ef4b86a70afdc1a2eea3f53ed1562575519"}}}' -i @setup.clj -m cljs.main
@mfikes
mfikes / README.md
Last active March 8, 2018 01:04
Browser REPL stress test

Run the test.clj below in a Clojure REPL, adjusting the cmd vector as needed to launch things.

It will launch the browser REPL and imitate a user typing forms into it. (If you don't have Safari set as your default browser, you can splice ["-ro" "{:launch-browser false}" "-r"] into the end of the cmd vector and launch Safari manually, pointing it at http://localhost:9000

In your browser open the JavaScript console to see progress.

A faster verzion, zippy.clj eliminates the JavaScript console logging and the Thread/sleep calls, evaluating the sequence of integer forms as quickly as possible.

To instead compare with Figwheel, do

(require 'tubular.core)
(tubular.core/connect "127.0.0.1" REPL_PORT)
@jordwalke
jordwalke / gist:6350319
Last active September 10, 2016 16:27
ReactJS: JavaScript just like you've always done it.
/**
* ReactJS: JavaScript like you've always done it.
*
* This example renders your top ten most followed friends/followers, `filter`ing
* only your favorites, and putting a star on all verified accounts.
*
* With ReactJS, any time your data changes, the UI is always brought up to date
* automatically. If friends length changes, or followCount - it always shows what
* `render` describes.
*/
@Deraen
Deraen / editor_plugin.cljs
Last active October 17, 2015 23:25
Extending Closure Classes From Clojurescript. Original source: http://www.50ply.com/blog/2012/07/08/extending-closure-from-clojurescript/
(ns frontend.editor-plugin
(:require-macros [frontend.goog-extend :refer [goog-extend]])
(:import [goog.editor Plugin]))
; 4. Now the code should work with advanced compilation but Closure Compiler
; will display few warnings about using "this" in static functions.
; To fix this, the constuctor should have proper JSDoc comments:
(goog-extend ^{:jsdoc ["@constructor" "@extends {goog.editor.Plugin}"]} FooPlugin Plugin
([]
; 1. This doesn't work with advanced compilation as Closure compiler checks that first
@mfikes
mfikes / ideas.md
Created June 6, 2015 16:35
Figwheel light ideas

It would be interesting if Figwheel could essentially decorate any implementation of IJavaScriptEnv, taking on the responsibility of watching the filesystem (perhaps even delegating that to ClojureScript :watch, and expanded :watch-fn, and perhaps minimally calling IJavaScriptEnv -load when Figwheel determines it is needed.

Then, for those REPLs that can participate, if IFigwheelSupport can be extended to them, they can do further cool stuff. (Perhaps IFigwheelSupport is actually necessary while IJavaScriptEnv as described in the previous paragraph is insufficient, and a more fancy impl of -load is needed?)

That way, things like the existing Node REPL could be minimally supported by Figwheel, as well as Ambly, the Browser REPL, etc.

What does IFigwheelSupport do?

Perhaps somewhere there is a HUD interface and Figwheel can ask a REPL to display things on its HUD? An iOS or Android-specific REPL could delegate to Objective-C or Java that implement a HUD using platform-specific UI widgets