Skip to content

Instantly share code, notes, and snippets.

View euhmeuh's full-sized avatar
🌈
Harvesting rainbows

Zoé Martin euhmeuh

🌈
Harvesting rainbows
View GitHub Profile
@euhmeuh
euhmeuh / userChrome.css
Last active December 9, 2019 10:50
Custom style for Firefox tabs
/*
Put this file in:
- <your profile folder>/chrome/userChrome.css
Then set up the configuration key:
- toolkit.legacyUserProfileCustomizations.stylesheets = true
*/
tab[pinned="true"] .tab-icon-image {
filter: grayscale(100%) invert();
@euhmeuh
euhmeuh / uuid.sh
Created February 20, 2019 15:31
Generate UUID
cat /proc/sys/kernel/random/uuid
@euhmeuh
euhmeuh / include-raw.fs
Last active December 20, 2018 12:48
Create a Forth word containing the bytes of a given file
$FFFF constant FILE-MAX-SIZE
: >rcopy ( a -- a ) ( R: -- a )
compile dup
compile >r
; immediate
: rfetch> ( -- a ) ( R: a -- a )
compile r>
compile dup
@euhmeuh
euhmeuh / csarray.fs
Created December 17, 2018 16:04
Forth experiments
\ === Create a constant string array ===
: count ( addr -- addr size )
\ this function may be standard in some forths
dup +1 swap c@
;
: csarray ( here nstrings -- )
create
0 do
@euhmeuh
euhmeuh / config.yml
Last active December 13, 2018 15:37
amp config
keymap:
normal:
",": view::scroll_down
";": view::scroll_up
delete: buffer::delete
# Command mode like Vim
":": application::switch_to_command_mode
# Swap "delete line" and "small jump" because delete was to close
@euhmeuh
euhmeuh / compose.js
Created October 17, 2018 09:20
Javascript composition
function sequence() {
const funcs = arguments;
return function(x) {
return Array.from(funcs).reduce((x, func) => func.call(null, x), x);
};
}
function compose() {
return sequence.apply(null, Array.from(arguments).reverse());
}
@euhmeuh
euhmeuh / keybindings.json
Created October 9, 2018 08:15
VSCode Settings
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "ctrl+shift+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+alt+down",
"command": "-editor.action.copyLinesDownAction",
@euhmeuh
euhmeuh / hello-urlang.rkt
Created September 12, 2018 09:44
Urlang wrapper
#lang s-exp "urlang.rkt"
(define (hello name)
(console.log (+ "Hello " name "!")))
(hello "Urlang world")
@euhmeuh
euhmeuh / modules.rkt
Last active June 22, 2018 14:34
Modules in Racket
;; How modules work in Racket
(require fruits) => "fruits/main.rkt"
(require fruits/banana) => "fruits/banana.rkt"
#lang fruits => "fruits/lang/reader.rkt" OR (submod "fruits/main.rkt" reader)
#lang fruits/apple => "fruits/apple/lang/reader.rkt" OR (submod "fruits/apple.rkt" reader)
fruits
|
+- main.rkt (require fruits)
@euhmeuh
euhmeuh / git-rewrite-email.sh
Created May 29, 2018 10:45
Rewrite emails in a git history
git filter-branch --commit-filter '
if [ "$GIT_AUTHOR_EMAIL" = "old.mail@example.com" ];
then
GIT_AUTHOR_NAME="username";
GIT_AUTHOR_EMAIL="new.mail@example.com";
git commit-tree "$@";
else
git commit-tree "$@";
fi' HEAD