Skip to content

Instantly share code, notes, and snippets.

View razzius's full-sized avatar
🍉

Razzi Abuissa razzius

🍉
View GitHub Profile
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<script>
const KEY_NAMES = {
enter: 'ret',
' ': 'spc',
escape: 'esc',
function toTest(a, b) {
return a + b
}
function debug(fn) {
return function() {
console.log(`Going to call ${fn.name} with ${[].slice.call(arguments).join(', ')}`)
result = fn.apply(this, arguments)
console.log(`Got result from ${fn.name} of`, result);
return result
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<script>
function parseKeyname(keyname) {
const parts = keyname.toLowerCase().split('-')
const modifiers = parts.slice(0, -1)
const key = parts[parts.length - 1]
function album --argument the_album
set script (echo "\
for f in \"$the_album\"*.{flac,mp3,m4a};
afplay \"\$f\";
end
")
begin
fish -c "$script"
end
end
@razzius
razzius / local.jupyter.notebook.plist
Created September 16, 2019 22:02
/Users/razzi/Library/launchAgents/local.jupyter.notebook.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>KeepAlive</key>
<false/>
<key>RunAtLoad</key>
<true/>
bind \ct transpose-chars
# emacs ansi-term support
if test -n "$EMACS"
set -x TERM eterm-color
end
# this function may be required
function fish_title
true
# Defined in /var/folders/7v/b0z6dsqj1fx8k5rf8x121l580000gn/T//fish.n55H23/music.fish @ line 2
function music
cd ~/Music/iTunes/iTunes\ Media/Music/
set song (fzf -1 -q "$argv")
afplay $song
end
#!/usr/bin/env python3.7
import argparse
import sys
from ripgrepy import Ripgrepy
parser = argparse.ArgumentParser()
parser.add_argument('symbol')
parser.add_argument('repository')
args = parser.parse_args()
function toTest(a, b) {
return a + b
}
function debug(fn) {
return function() {
console.log(`Going to call ${fn.name} with ${[].slice.call(arguments).join(', ')}`)
result = fn.apply(this, arguments)
console.log(`Got result from ${fn.name} of`, result);
return result
@razzius
razzius / synchronized_polygons.html
Last active August 27, 2018 18:52
In google maps, drag one polygon, synchronizing another with it
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Draggable Polygons</title>
<style>
/* Always set the map height explicitly to define the size of the div
* element that contains the map. */
#map {