Skip to content

Instantly share code, notes, and snippets.

@lightdiscord
lightdiscord / keybase.md
Last active December 27, 2017 17:41
Keybase verification

Keybase proof

I hereby claim:

  • I am lightdiscord on github.
  • I am lightdiscord (https://keybase.io/lightdiscord) on keybase.
  • I have a public key ASCRe0I7qA1pgeop5W13yK6YxJdom4rq7zEldKWF73I1qgo

To claim this, I am signing this object:

@lightdiscord
lightdiscord / readable.js
Last active December 22, 2017 21:25
Normally, you should be able to read these sentences...
const match = sentence => sentence.match();
const word_manipulation = word => {
const characters = [...word]
const start = characters.shift() || ''
const end = characters.pop() || ''
return `${start}${characters.map((a) => [Math.random(),a]).sort((a,b) => a[0]-b[0]).map((a) => a[1]).join('')}${end}`
}
@lightdiscord
lightdiscord / Keys.md
Last active February 6, 2019 11:40
My public keys

My Public Keys

Here you can find both my public pgp & ssh key.

@lightdiscord
lightdiscord / Hooks.md
Last active January 10, 2018 13:38
Gitlab webhook requests

Gitlab webhooks requests

@lightdiscord
lightdiscord / ec2.sh
Created March 21, 2018 16:05
Install my nixos configuration on ec2 machine
#!/usr/bin/env bash
cd /etc/nixos
rm configuration.nix
nix-shell -p git --run "git clone git@github.com:LightDiscord/nixos-system.git ."
ln -s machines/ec2.nix configuration.nix
nix-channel --add "https://nixos.org/channels/nixos-unstable"
nixos-rebuild switch --upgrade
@lightdiscord
lightdiscord / fsquare.js
Last active April 4, 2018 07:18
f(x)=x²
const forms = [
() => {
const limits = [...new Array(2)].map(()=>~~(Math.random()*40)-20)
const symbols = ['<', '≤'].map((v,i,a)=>a[~~(Math.random()*a.length)])
return `${Math.min(...limits)}${symbols[0]}x${symbols[1]}${Math.max(...limits)}`
},
() => {
const symbols = ['<', '≤', '=', '≥', '>']
return `x${symbols[~~(Math.random()*symbols.length)]}${~~(Math.random()*40)-20}`
@lightdiscord
lightdiscord / default.nix
Last active October 13, 2022 04:41
Rust and wasm with nixos
with import <nixpkgs> {
overlays = map (uri: import (fetchTarball uri)) [
https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz
];
};
stdenv.mkDerivation {
name = "rust-wasm";
buildInputs = [
cargo-web
@lightdiscord
lightdiscord / netlify.sh
Last active July 5, 2021 15:20
Rust and wasm and netlify
#!/usr/bin/env bash
set -e
cweb_version=0.6.16
cweb=https://github.com/koute/cargo-web/releases/download/$cweb_version/cargo-web-x86_64-unknown-linux-gnu.gz
curl -Lo cargo-web.gz $cweb
gunzip cargo-web.gz
chmod u+x cargo-web
@lightdiscord
lightdiscord / shell.nix
Created June 7, 2019 11:40
Postgresql inside nix-shell
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "postgresql-inside-nixshell";
buildInputs = [
postgresql
];
shellHook = ''
(() => {
const words = [...document.querySelector('#words').firstChild.children].map(child => child.innerText);
const input = document.querySelector('#inputfield');
words.forEach(word => {
input.value = word;
input.dispatchEvent(new KeyboardEvent('keyup', { keyCode: 32, which: 32 }));
});