Skip to content

Instantly share code, notes, and snippets.


fiatjaf fiatjaf

View GitHub Profile

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

mathisonian /
Last active Jul 23, 2020
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details:


mywarr /
Last active Apr 30, 2020
use mdbtools to convert .mdb to .sqlite and .csv
#!/usr/bin/env python
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
import sys, subprocess, os
DATABASE = sys.argv[1]
View $HOME .nix-profile etc profile.d
#! /usr/local/bin/fish
if test -n "$HOME" ;
set -xg NIX_LINK "$HOME/.nix-profile"
# Set the default profile.
if not test -L "$NIX_LINK" ;
echo "creating $NIX_LINK" >&2
set -l _NIX_DEF_LINK /nix/var/nix/profiles/default
/nix/store/cdybb3hbbxf6k84c165075y7vkv24vm2-coreutils-8.23/bin/ln -s "$_NIX_DEF_LINK" "$NIX_LINK"
lsowen / check_sig.go
Last active Jul 31, 2019
GPG Signature Verification in go (with
View check_sig.go
package main
import (
func main() {
keyRingReader, err := os.Open("signer-pubkey.asc.txt")
View ToInt.hs
data ToInt a = ToInt (a -> Int)
instance Functor ToInt where
-- note, f :: a -> b; g :: a -> Int, and the todo :: b -> Int
fmap f (ToInt g) = ToInt (error "todo")
class Contravariant f where
contramap :: (b -> a) -> f a -> f b
instance Contravariant ToInt where
rhythmus /
Last active Oct 4, 2018
Proposal for a lightweight, database-less, general purpose, name-based file management app

Proposal for a lightweight, database-less, general purpose, name-based file management app

First draft, Easter Sunday 2014

In line with current trends toward lean and simple software solutions reviving and repurposing long-established standards (open plain text vs proprietary rich text formats; file-based static site generators vs bloated database-driven CMSs), the present proposal inquires into a method (and its application) to device a lightweight, general-purpose solution for small-scale digital asset management.

No database is to be used, there shall be no external dependencies, all information carriers should be self-containing, and everything would be file-based. The software would build on a (yet to be established) convention of file naming, which would store metadata for arbitrary files inside the file name, advancing its portability across platforms.

Put as a — somewhat far-fetched — YC-style one-liner pitch: this proposal is about *

lxcodes / gist:1010364
Created Jun 6, 2011
Set Cursor at the End of a ContentEditable
View gist:1010364
function setEndOfContenteditable(contentEditableElement)
var range,selection;
if(document.createRange)//Firefox, Chrome, Opera, Safari, IE 9+
range = document.createRange();//Create a range (a range is a like the selection but invisible)
range.selectNodeContents(contentEditableElement);//Select the entire contents of the element with the range
range.collapse(false);//collapse the range to the end point. false means collapse to end rather than the start
selection = window.getSelection();//get the selection object (allows you to change selection)
selection.removeAllRanges();//remove any selections already made
passcod /
Created Mar 11, 2015
Emscripten build process for jq
emconfigure ./configure --disable-maintainer-mode
make clean
env CCFLAGS=-O2 emmake make LDFLAGS=-all-static CCFLAGS=-O2 -j4
cp jq jq.o
emcc -O2 jq.o -o jq.js
plugnburn /
Last active Mar 27, 2016
Psto: a single package.json to scaffold and run your single-post web page in no time


This is a no-brainer to get your single-post web page up and running. Just have to have Node and NPM installed, and /bin/sh pointing to Bash shell. Styling is powered by 999.css.


  1. Place the below package.json into an empty directory and enter this directory in your command line prompt.
  2. Run npm run scaffold.
  3. Edit domain, title and author in the config section of your package.json. The domain may be either a Surge subdomain or your own (please refer to the Surge docs). If you're going to host your page yourself, you may leave domain empty.
You can’t perform that action at this time.