Skip to content

Instantly share code, notes, and snippets.

{
"description": "Caps Lock to ESC on tap/Left Control on hold",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
"any"
]
@kurtharriger
kurtharriger / gist:7bd07ef03a9b28725f6f765f085455ac
Last active February 14, 2024 02:13
electric clojure server auth
#?(:cljs (def !client-jwt-token (atom nil)))
(def !user (atom nil))
(e/def user (e/watch !user))
(def ^:dynamic *user* nil)
(e/defn ProvideUserContext []
(e/client
(let [token (.getItem js/localStorage token-local-storage-key)]
(reset! !client-jwt-token token)))
@kurtharriger
kurtharriger / user.clj
Created December 29, 2021 01:05
dime app helper
(ns user
(:require
[app.server :as server]
[dime.core :as di]
[dime.var :as dv :refer [defconst]]))
(def app-namespaces
['app.ynab
'app.budget
'app.parser
@kurtharriger
kurtharriger / types.d.ts
Last active December 31, 2022 16:34
Inferred Workflowy API
type ProjectId = string; // eg: 2a13b3e1-7a74-3b2b-9758-1b398845a8e8
type UserId = number;
type ShareId = string;
type ClientId = string;
// login
// response sessionid returned in set-cookie
// curl -X POST https://workflowy.com/accounts/login/ -F 'username=<username>' -F'password=<password>' -H 'accept: application/json' -D -
export interface LoginFormData {
username: string;
@kurtharriger
kurtharriger / yarn.lock
Created April 10, 2018 05:49
prosemirror range error
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/node@*":
version "9.4.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.0.tgz#b85a0bcf1e1cc84eb4901b7e96966aedc6f078d1"
JSONStream@^1.0.3:
version "1.3.2"
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// ::- Persistent data structure representing an ordered mapping from
// strings to values, with some convenient update methods.
function OrderedMap(content) {
this.content = content;
}
OrderedMap.prototype = {
constructor: OrderedMap,
;; bootstrap use-package
;; http://cachestocaches.com/2015/8/getting-started-use-package/
(require 'package)
(setq package-enable-at-startup nil)
;;(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(package-initialize)
@kurtharriger
kurtharriger / index.js
Created February 1, 2017 16:31
Shopify paging issue
const Shopify = require('shopify-api-node');
const R = require('ramda');
const shopify = new Shopify(...);
const list = (limit, since_id) => {
return (
shopify.product.list({fields: 'id', since_id, limit})
.then(products => {
if(products.length >= limit) {
@kurtharriger
kurtharriger / install-elasticsearch.sh
Last active February 9, 2016 22:19
Install elasticsearch on ec2 node
#! /bin/bash
set -e
AWS_ACCESS_KEY=$1
AWS_SECRET_KEY=$2
if [ -z "$AWS_SECRET_KEY" ]; then
echo "usge: $0 <aws_access_key> <aws_secret_key"
exit 2
fi
@kurtharriger
kurtharriger / Example.elm
Created November 25, 2015 21:16
DragAndDrop with Library
import DragAndDrop exposing (..)
import Html exposing (div, p, text)
import Html.Attributes exposing (draggable)
import Html.Events exposing (onClick)
import Signal exposing (foldp)
import Color exposing (black)
hover = Signal.mailbox False
box = p [draggable "true", (onClick hover.address True)] [text "drag-and-drop me"]