Skip to content

Instantly share code, notes, and snippets.

View adamrenklint's full-sized avatar

Adam Renklint adamrenklint

View GitHub Profile
@dustingetz
dustingetz / electric-todomvc.md
Last active August 6, 2023 03:30
Photon TodoMVC, with a twist!

TodoMVC, with a twist! — Electric Clojure

  1. it's multiplayer! 0 LOC cost
  2. state is durable! (server side database) 0 LOC cost
  3. See those pending spinners? We've added a server delay to demonstrate managed load states.
20220817.todomvc.mp4

Electric is a "multi tier" Clojure/Script dialect for full-stack web application development. It uses macros to let you interweave client and server code in a single .CLJC file, so you can define a full-stack frontend/backend webapp all in one place. Electric is designed for rich dynamic applications with reactive user interfaces and complex frontend/backend data sync requirements.

@pesterhazy
pesterhazy / indexeddb-problems.md
Last active May 27, 2024 07:40
The pain and anguish of using IndexedDB: problems, bugs and oddities

This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).

Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.

Backing file on disk (WAL file) keeps growing (Safari)

When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.

Random exceptions when working with a large number of indexeddb databases (Safari)

@tuchella
tuchella / functions.json
Created August 30, 2019 10:13
Tidal function list as json/yaml
[
{
"name": "accelerate",
"help": "`accelerate` turns a number pattern into a control pattern that speeds up (or slows down) samples while they play.",
"cmd": "accelerate :: Pattern Double -> ControlPattern",
"paramTypes": [
"Pattern Double"
],
"returnType": "ControlPattern",
"links": [
@jdubie
jdubie / macros.clj
Last active March 5, 2017 12:30
ClojureScript macros.
;; nice for reagent
(defmacro defc
"syntactic sugar for declaring stateful components. Keeps signature of inner
and outer params consistent.
Before:
(defn stateful-component
[params]
(let [local state]
@jsdf
jsdf / ReactNativeRefreshableListView.js
Last active September 15, 2023 07:29
React Native pull down to refresh ListView
// for an updated version see https://github.com/jsdf/react-native-refreshable-listview
var React = require('react-native')
var {
ListView,
ActivityIndicatorIOS,
StyleSheet,
View,
Text,
} = React
@justinhillsjohnson
justinhillsjohnson / gist:5503121
Created May 2, 2013 15:43
code-review-checklist
General
1. Site uses a cache buster for expiring .js, .css, and images
2. JavaScript and CSS is minified and concatenated into logical groupings
3. Images have been optimized by ImageOptim (http://imageoptim.com/)
Markup
1. Code does not contain inline JavaScript event listeners
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 24, 2024 14:56
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@n1k0
n1k0 / meta-extract.js
Created January 21, 2012 07:02
CasperJS script to extract meta informations
var casper = require("casper").create()
, url = casper.cli.get(0)
, metas = [];
if (!url) {
casper.echo('Usage: casperjs [url]').exit();
}
casper.on('remote.message', function(msg) {
console.log(msg);
@billdawson
billdawson / record_and_share.js
Created February 22, 2011 21:32
Uses Titanium Mobile (Android) to make a voice recording and share it
var win = Ti.UI.createWindow({
title: 'Sound Recorder Test',
exitOnClose: true,
fullscreen: false,
backgroundColor: 'black'
});
// const value grabbed from
// http://developer.android.com/reference/android/provider/MediaStore.Audio.Media.html#RECORD_SOUND_ACTION
var RECORD_SOUND_ACTION = "android.provider.MediaStore.RECORD_SOUND";