Skip to content

Instantly share code, notes, and snippets.

@nsfmc
nsfmc / jj-adopt.fish
Created October 26, 2026 16:09
use this to adopt somebody's branch on github
function jj-adopt --description 'jj bookmark track + new for a remote branch/bookmark name'
argparse h/help r/retroactive B/allow-backwards -- $argv
or return 1
if set -q _flag_help
echo "usage: jj-adopt [--retroactive [--allow-backwards]] [branch]
Track an origin branch as a local jj bookmark and start working on it.
With no branch, uses the closest origin bookmark between trunk() and @.
// Rolling your own passkey auth in js, both on the web and in node.
// passkeys are pretty well supported in the browser, but there's a lot
// of simple crypto and bit twiddling that you need to do. it all adds up
// to a lot, but it's all quite straightforward in nature.
// this can be a good resource to pair with imperialviolet's passkey article.
// except for browser js/node js instead of typescript/python.
// Some utility methods here to convert from b64 encoded strings to Uint8Arrays and back

here is a phone number 555-123-1212 617-253-8810

@nsfmc
nsfmc / index.js
Created July 12, 2018 17:38
super minimal server react setup
import React from 'react';
import ReactDOMServer from 'react-dom/server';
import express from 'express'
const app = express();
app.get('/', (_, res) => {
console.log()
@nsfmc
nsfmc / index.js
Last active April 29, 2018 03:06
@nsfmc/babel-preset-sketching, a babel 7 preset for when i just want things to work the way i expect
module.exports = function(api, opts) {
const prod = process.env.NODE_ENV === "production";
return {
presets: [
[
require("@babel/preset-env"),
{
targets: {
browsers: [">1%", "not ie 11"]
@nsfmc
nsfmc / chouch.js
Created March 7, 2018 20:27
a bad couch implementation
const request = require('superagent');
class CouchClient {
constructor(db, host='http://localhost:5984') {
this.host = host;
this.db = db;
}
view(designDoc, viewName, opts = {}) {
Verifying my Blockstack ID is secured with the address 12yroXUpFaXP4bL9wxw3LARRX8Be8HYZui https://explorer.blockstack.org/address/12yroXUpFaXP4bL9wxw3LARRX8Be8HYZui
// @flow
import {parse} from 'babylon';
const commonParser = (input: string) => parse(input, {
sourceType: 'module',
plugins: ['jsx', 'flow'],
});
const bodyParser = (input: string) => commonParser(input).program.body;
@nsfmc
nsfmc / training.md
Last active February 28, 2017 23:35

Getting started

getting started using dynamic labels is as easy as 1 2 4! First copy the following text:

<first name> is a dynamic label for someone's <name>

@nsfmc
nsfmc / readme.md
Created January 25, 2017 19:20
returns the most common padding/margin values

assuming you got a list of margin/padding values from your css with

ack --css margin > margin.txt
ack --css padding > padding.txt

you can run