Skip to content

Instantly share code, notes, and snippets.

// Adapted from: https://digitalbunker.dev/2020/09/13/understanding-gaussian-blurs/
function gaussianBlurMatrix(blurRadius: number) {
if (blurRadius !== Math.round(blurRadius) || blurRadius <= 0) {
throw Error('Blur radius must be a positive integer')
}
const kernel: number[] = []
const kernelWidth = 1 + 2 * blurRadius
const kernelSize = kernelWidth * kernelWidth
import * as bip32 from 'bip32';
import * as BufferLayout from 'buffer-layout';
import _ from 'lodash';
import nacl from 'tweetnacl';
import { Service } from 'typedi';
import {
Account, Connection, PublicKey, SystemProgram, SYSVAR_RENT_PUBKEY, Transaction,
TransactionInstruction
} from '@solana/web3.js';

James Edward Butler – Developer and SRE

I am an experienced developer and SRE with over 13 years experience designing architecture for, building and running web, mobile and cloud-based large scale infrastructures. I write application features as well as infrastructure-centric tooling. I have worked as an individual contributor and led technical teams, and would consider doing either in the future

Employment History

Centrica / Hive - Senior Developer

May 17 - June 22

Designed, rolled out and maintained fully automated end 2 end CI/CD pipeline + production infra for rollout of new web-based customer dashboard (JS + React) and development of supporting public facing HTTP apis (NodeJS deployed on AWS Lambda).

@defulmere
defulmere / gist:438b3cf94cc725c6a67e40888e1e280a
Last active November 19, 2024 21:30
colored bar graph of system load over time in terminal with atopsar
np=$( nproc ); atopsar -p | grep ":[0-9]\{2\}\s\+[0-9]" | awk '{printf("\n%s %6.2f ",$1, $5); for (i = 0; i<$5; i++) {if (i<'$np'*.7) {printf "\033[32m"} else if (i<'$np') {printf "\033[33m"} else {printf "\033[31m"}; printf("█")}; printf "\033[0m"}'; echo ""
From 159aed38500c055111dc838d6ddbd644e17c4298 Mon Sep 17 00:00:00 2001
From: Kaushal M <[email protected]>
Date: Thu, 15 Apr 2021 01:35:45 +0530
Subject: [PATCH] 1password: Add native-messaging-host config for
Chrome/Chromium
---
1password/.SRCINFO | 5 +++--
1password/PKGBUILD | 11 +++++++++--
1password/com.1password.1password.json | 10 ++++++++++
updated inheritance
parent: //base/trace_event
child: //services/tracing
gain: teamEmail: u'[email protected]'
updated inheritance
parent: //chrome/browser/nearby_sharing
child: //chromeos/services/nearby
gain: teamEmail: u'[email protected]'
updated inheritance
parent: //chrome/browser/ash/login/easy_unlock
@benogle
benogle / api-throttling-429-error-handling.js
Created March 29, 2021 22:36
An example script consuming an API with various throttling and 429 "too many requests" error handling strategies.
// An example script consuming an API with various throttling and 429 error
// handling strategies.
//
// Blog post with more context
// https://www.useanvil.com/blog/2021-03-29-throttling-and-consuming-apis-with-429-rate-limits
//
// License: MIT
import fetch from 'node-fetch'
import mapLimit from 'async/mapLimit'
@amatiash
amatiash / get-my-kin.js
Last active November 13, 2021 05:42
Convert Stellar KIN keys into Solana KIN keypair
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var web3_js_1 = require("@solana/web3.js");
var hex_to_32_1 = __importDefault(require("hex-to-32"));
var atob_1 = __importDefault(require("atob"));
var bs58_1 = __importDefault(require("bs58"));
// ----------------------------------------------------
@sindresorhus
sindresorhus / esm-package.md
Last active August 2, 2025 05:16
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@fukaoi
fukaoi / memo-exmaple.js
Last active July 24, 2022 22:54
solana-program-library-memo
const {
Keypair,
Transaction,
TransactionInstruction,
PublicKey,
Connection,
sendAndConfirmTransaction,
LAMPORTS_PER_SOL,
} = require("@solana/web3.js");