The article previously hosted here is now published on my website: My ErgoDox Keyboard.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
As seen on: http://danielsz.github.io/2014/02/28/The-pleasantness-of-Om/ | |
Additional feature: <SPACE> and Time advance | |
Missing feature: Randomizer for List | |
-} | |
import Keyboard | |
-- Model | |
type Testimonial = { shopName:String, | |
shopOwner:String, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns om-transition.core | |
(:require [om.core :as om :include-macros true] | |
[om.dom :as dom :include-macros true])) | |
(enable-console-print!) | |
(def ctg (aget js/React "addons" "CSSTransitionGroup")) | |
(def app-state (atom ["test"])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ratelimit | |
"Implement rate limiting using a token bucket" | |
(:require [clojure.core.async :as async :refer [<!! >! alts! go chan dropping-buffer close! timeout]])) | |
(defprotocol TokenBucket | |
(take-token [this]) | |
(release [this])) | |
(defn- ->period-ms [p] | |
(if (keyword? p) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns example.errors) | |
(defn clean-address [params] | |
"Ensure (params :address) is present" | |
(if (empty? (params :address)) | |
[nil "Please enter your address"] | |
[params nil])) | |
(defn clean-email [params] | |
"Ensure (params :email) matches *@*.*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### HA Proxy | |
// PROXY BASED ON SUB-DOMAIN | |
frontend public | |
bind *:80 | |
acl is_websocket hdr_end(host) -i ws.example.com | |
use_backend ws if is_websocket | |
default_backend www | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2017 Google Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javafx.beans.property.SimpleBooleanProperty; | |
import javafx.geometry.Pos; | |
import javafx.scene.control.Button; | |
import javafx.scene.control.Label; | |
import javafx.scene.layout.HBox; | |
public class ToggleSwitch extends HBox { | |
private final Label label = new Label(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns metosin.common.edn | |
#+clj | |
(:require [clj-time.format :as f]) | |
#+cljs | |
(:require [cljs-time.format :as f] | |
cljs.reader) | |
#+clj (:import [org.joda.time DateTime LocalDate])) | |
;; | |
;; #DateTime tagging |
journalctl
is the systemd tool for viewing and tailing system logs. It's cool but has one infuriating bug: when you hit ^C,
it kills both journalctl and your pager.
less
has lots of useful behavior based on ^C
(such as to stop tailing a log), so this makes journalctl
practically
useless in my view :)
It sets the K
option on less
which has this effect, but then it also sends SIGTERM itself when journalctl
receives
SIGINT, so unsetting that K
is not effective, either.
OlderNewer