Skip to content

Instantly share code, notes, and snippets.

@satazor
satazor / git-remove-file
Last active December 16, 2015 02:38
Remove a file permanently from a repo
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch components' --prune-empty --tag-name-filter cat -- --all
@satazor
satazor / bashprofile
Last active December 18, 2015 14:18
Bash profile (additional bash settings)
# make ls display colors, reinforce with CLICOLOR and LSCOLORS
export CLICOLOR=1
# customize prompt
PS1='\e[1;32m\u\e[00m@\h \e[0;31m\w\e[00m\n$ '
# aliases
alias ll='ls -la'
alias work='cd ~/Work'
alias baboom='cd ~/Work/baboom'
### Keybase proof
I hereby claim:
* I am satazor on github.
* I am satazor (https://keybase.io/satazor) on keybase.
* I have a public key ASAVKr-ZCtMccwMWU3Bfx8PyKSXjZqlg3--wNAEWkGj7Lgo
To claim this, I am signing this object:

True serverless

This workshop will introduce you to the Web of the future: the Decentralized Web. While the Web is decentralized and distributed by nature, it rapidly become monopolized by corporations and businesses, generating a highly centralized web.

You will learn about technologic breakthroughs that enable us to build decentralized P2P applications that feel realtime, collaborative and are offline-first.

We will dig into converting a local Web application into its decentralized counterpart by using IPFS and CRDTs.

Requirements:

@satazor
satazor / identity-breakdown.md
Last active January 8, 2019 16:19
Identity breakdown

1. Backend track

1.1. IPID

Depends on: 1.6

It's very important for DAPPs based on IPFS that they work in a P2P fashion.

As an example, the login feature of uPort requires you to create an application on their end. During this process, a unique and secret code is given to you which you should use when calling the uPort API. Since we want our applications to run entirely on clients, developers can't hide this secret since it would live within the JavaScript frontend code. This secret code is their only way to identify the applications requesting to login in a secure manner.

@satazor
satazor / join-url.js
Last active November 3, 2019 17:04
join-url
import queryString from 'query-string';
const defaultUrlRegExp = /^(\w+:\/\/[^/?]+)?(.*?)(\?.+)?$/;
const protocolRelativeUrlRegExp = /^(\/\/[^/?]+)(.*?)(\?.+)?$/;
const normalizeParts = (parts) => (
parts
// Filter non-string or non-numeric values
.filter((part) => typeof part === 'string' || typeof part === 'number')
// Convert to strings
@satazor
satazor / node_app.mjs
Created May 14, 2024 23:59 — forked from mayankchoubey/node_app.mjs
Node.js - JWT sign & verify
import jwt from "jsonwebtoken";
import { readFileSync } from "node:fs";
import { createSecretKey } from 'node:crypto';
const emails = JSON.parse(
readFileSync(
"/Users/mayankc/Work/source/perfComparisons/testdata/emails.json",
),
);