Skip to content

Instantly share code, notes, and snippets.

Avatar

Pierre turbo

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am turbo on github.
  • I am summarity (https://keybase.io/summarity) on keybase.
  • I have a public key ASC5Q6LSQZZbPDrDDBF50nd843R0xlR60h5vD3lyHqFgkAo

To claim this, I am signing this object:

View hotkeys-usage.js
import { createContext } from './hotkeys';
const c = createContext();
// Alerts when "no way" is typed in.
c.register('n o space w a y', () => {
alert('Yes way!');
});
/*
@turbo
turbo / hotkeys.js
Created May 15, 2020 — forked from abuduba/hotkeys.js
Hotkey library
View hotkeys.js
const isEqual = (a, b) => {
const aKeys = Object.keys(a);
if (aKeys.length !== Object.keys(b).length) {
return false;
}
return aKeys.every(
(k) => Object.prototype.hasOwnProperty.call(b, k)
&& a[k] === b[k],
@turbo
turbo / brio.md
Last active Apr 8, 2020
Recording 4k 4:2:2 from Brio 4k In Linux using FFMpeg
View brio.md

Turn auto-exposure off, set absolute exposure to a low level and use gain to compensate for low light if needed. E.g.:

v4l2-ctl -d /dev/video2 -c exposure_absolute=400
v4l2-ctl -d /dev/video2 -c gain=110

# check with
v4l2-ctl -d /dev/video2 -L
View fargate.yml
XS-1X: &xs-1x
limits:
memory: "490Mi"
cpu: "240m"
requests:
memory: "490Mi"
cpu: "240m"
XS-2X: &xs-2x
limits:
View app.fnl
; vi: ft=clojure
; THIS IS A Fennel SOURCE FILE (.fnl) !NOT! clojure!
; you need to use luajit to run this, after using fennel --compile
; install lapis and turbo from luarocks
; When running with Fennel directly, you need to --globals all used HTML tags
(local turbo (require "turbo"))
(local render_html (. (assert (require "lapis.html")) :render_html))
View test.fnl.clj
(macro make [receiver classtable bodyfn]
`(local ,receiver (doto (class ,(tostring receiver) ,classtable)
(,bodyfn))))
; Handler that takes a single argument 'username'
(make UserHandler turbo.web.RequestHandler #(-> $1
(tset :get (fn [self name]
(self:write (.. "Username is " name))))))
@turbo
turbo / app.fnl.clj
Last active Jun 22, 2021
Write a Fennel Web App using Lapis and Turbo
View app.fnl.clj
; THIS IS A Fennel SOURCE FILE (.fnl) !NOT! clojure!
; you need to use luajit to run this, after using fennel --compile
; install lapis and turbo from luarocks
(local turbo (require "turbo"))
(local render_html (. (assert (require "lapis.html")) :render_html))
(fn render [parent expr]
(parent:add_header "Content-Type" "text/html")