Skip to content

Instantly share code, notes, and snippets.

Avatar

Adrian Hesketh a-h

View GitHub Profile
@a-h
a-h / keyboard.json
Created Jul 12, 2020
Anne Pro 2 keyboard layout
View keyboard.json
{"name":"Current","device":1,"model":5,"type":"layout","data":{"layer0":[41,30,31,32,33,34,35,36,37,38,39,45,46,42,43,20,26,8,21,23,28,24,12,18,19,47,48,49,192,4,22,7,9,10,11,13,14,15,51,52,40,225,29,27,6,25,5,17,16,54,55,56,82,193,224,227,44,226,80,81,79],"layer1":[53,58,59,60,61,62,63,64,65,66,67,68,69,76,0,0,82,0,0,0,0,0,82,0,70,74,77,0,192,80,81,79,0,0,0,80,81,79,75,78,0,0,53,0,0,0,0,0,0,0,73,76,75,193,224,227,0,226,74,78,77],"layer2":[0,200,201,202,203,0,0,0,0,241,240,244,243,76,0,0,82,0,0,0,0,0,82,0,70,74,77,0,192,80,81,79,0,0,0,80,81,79,75,78,0,0,53,0,0,0,0,0,0,0,73,76,75,193,224,227,0,230,74,78,77],"taps":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,0,0,0,0,0,80,81,79]},"crc":"40377b03"}
@a-h
a-h / 01-data.tsv
Last active Jul 16, 2020
Importing data into DynamoDB - code for blog post
View 01-data.tsv
ngram year match_count page_count volume_count
# 1574 1 1 1
# 1584 6 6 1
# 1614 1 1 1
# 1631 115 100 1
# 1632 3 3 1
# 1635 1 1 1
# 1640 1 1 1
# 1641 1 1 1
1935 2 2 1
@a-h
a-h / App.js
Created Apr 13, 2020
Firebase Test
View App.js
import React, {useEffect} from 'react';
import {AppState, Linking} from 'react-native';
import {Provider as PaperProvider} from 'react-native-paper';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
@a-h
a-h / main.go
Created Apr 13, 2020
Raspberry Pi LCD without i2c
View main.go
package main
import (
"fmt"
"os"
"time"
"github.com/stianeikeland/go-rpio"
)
@a-h
a-h / .zshrc
Last active Feb 8, 2020
.zshrc
View .zshrc
export PATH=/usr/local/go:/Users/adrian/go/bin/:$PATH
export PATH=/usr/local/bin/:$PATH
export PATH="$PATH:/Users/adrian/.dotnet/tools"
# Set the prompt.
NT_PROMPT_SYMBOL=❱
function precmd(){
autoload -U add-zsh-hook
setopt prompt_subst
@a-h
a-h / .vimrc
Last active Apr 8, 2020
My .vimrc
View .vimrc
" Plugins used
" Install vim-plug.
" https://github.com/junegunn/vim-plug
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" Install dependencies.
" python3 -m pip install --user --upgrade pynvim
" python -m pip install --user --upgrade pynvim
" :PlugInstall
@a-h
a-h / disablecaching.go
Created Aug 20, 2019
Disable caching and sniffing via HTTP headers
View disablecaching.go
func DisableCachingAndSniffing(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate;")
w.Header().Set("pragma", "no-cache")
w.Header().Set("X-Content-Type-Options", "nosniff")
next.ServeHTTP(w, r)
})
}
View on.json
{"lightId":"1","states":[true,true,true,true,true]}
You can’t perform that action at this time.