Skip to content

Instantly share code, notes, and snippets.

View nilswloka's full-sized avatar

Nils Wloka nilswloka

View GitHub Profile
@cstorey
cstorey / index.html
Created September 8, 2012 20:53
Using Flapjax in ClojureScript
<html>
<head>
<title>Flapjax Demo: Time 1</title>
</head>
<p>The time is <span class="fixedBlock"><span id="timer">not initialized</span></span>.</p>
<p>The time in seconds is <span class="fixedBlock"><span id="timer2">not initialized</span></span>.</p>
<script type="text/javascript" src="main.js"></script>
</body>
</html>
@domenic
domenic / promises.md
Last active July 17, 2025 03:03
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
(ns hammock-cafe.ui.history
(:require [io.pedestal.app.protocols :as p]
[io.pedestal.app.util.log :as log]
[io.pedestal.app.messages :as msg]))
(def last-page (atom nil))
(def dispatchers (atom {}))
(defn navigate [token]
@Deraen
Deraen / components.clj
Last active December 15, 2019 08:03
Compojure-api with Component
(ns foobar.components
(:require [com.stuartsierra.component :as component]
[compojure.api.sweet :refer :all]))
(defmethod compojure.api.meta/restructure-param :components
[_ components acc]
(update-in acc [:letks] into [components `(::components ~'+compojure-api-request+)]))
(defn wrap-components [handler components]
(fn [req]
@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active May 19, 2025 21:28
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"