Skip to content

Instantly share code, notes, and snippets.

View ianfabs's full-sized avatar

Ian Fabs ianfabs

View GitHub Profile
@ianfabs
ianfabs / kitty-themes.conf
Last active April 21, 2021 21:04
Kittens for kitty-themes!
kitten_alias ~/.config/kitty/try-theme.py try-theme
kitten_alias ~/.config/kitty/set-theme.py set-theme
@ianfabs
ianfabs / tuple.rs
Created November 15, 2019 20:49
A rust macro definition for creating tuples. Kinda useless, kinda cool.
#[macro_export]
#[doc = " generate tuple"]
macro_rules! tuple {
($($n: expr),*) => {($($n,)*)};
}
@ianfabs
ianfabs / element.js
Created November 14, 2019 02:45
A really dumb JSX library using the regular DOM. Needs work
const query = q => document.querySelector(q);
const queryAll = q => document.querySelectorAll(q);
const append = (p, c) => {
p.appendChild(c);
return p;
};
const text = t => document.createTextNode(t);
const element = (tag, attrs, children) => {
@ianfabs
ianfabs / README.md
Last active November 5, 2019 19:01
```hljs-meta
~/workspace
```$ export PATH
@ianfabs
ianfabs / list.md
Created September 3, 2019 23:46
A List of really cool web-based tools
@ianfabs
ianfabs / index.js
Created May 21, 2019 23:44
Zero-width char exploit
const toZW = (text) => {
const zeroPad = num => '00000000'.slice(String(num).length) + num;
const textToBinary = username => (
username.split('').map(char => zeroPad(char.charCodeAt(0).toString(2))).join(' ')
);
const binaryToZeroWidth = binary => (
binary.split('').map((binaryNum) => {
const num = parseInt(binaryNum, 10);
" vim:fileencoding=utf-8:foldmethod=marker
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
" Required:
@ianfabs
ianfabs / gist:d2663f80da08da55ad497fb7f280006b
Last active May 21, 2019 22:13 — forked from xvrdm/gist:72e7eb17fa0f351a1d7550663f8bf713
Gruvbox Colorscheme for Kitty Terminal
#: Color scheme {{{
foreground #ebdbb2
background #282828
#: black
color0 #282828
color8 #928374
#: red
#!/bin/bash
RED='\033[0;31m'
BLUE='\033[0;34m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
#Update and install necesary tools
echo "${BLUE}UPDATING AND INSTALLING TOOLS ${NC}\n"
sudo apt update
@ianfabs
ianfabs / one-liners.js
Created March 5, 2019 16:10
A collection of lovely one-liners that I use
// A sleep implementation in javascript
const sleep = t => new Promise(r=>setTimeout(r,t));
// A function that rearranges an object returned by mongoose to play nicely with graphql resolvers
const objectify = o => (o.isArray()?o.map(e=>objectify(e)):({...o.toObject(),_id:o._id.toString()}));