Skip to content

Instantly share code, notes, and snippets.

View bpevs's full-sized avatar
🎵
vx1.bpev.me

Ben Pevsner bpevs

🎵
vx1.bpev.me
  • Previously @ Playstation Network, Honey
  • 07:31 (UTC -06:00)
View GitHub Profile
@bpevs
bpevs / takeout_to_geojson.js
Last active November 19, 2023 00:37
Parse Google Takeout results into a geojson file
// Google maps does already export to geo-json, but that doesn't take lists
// into account. This script maps the `Saved` csv files, maps data to
// `Maps (your places)`, and outputs a set of geojson files for each list.
// Requirements:
// - All locations must be "starred". This puts it in the "Saved Places.json".
//. - Notes can be in a list location.
// - Lists must NOT HAVE a "List description". It fucks up the csv parsing.
// Once you verify this, create a Google takeout that includes:
@bpevs
bpevs / README.md
Last active January 31, 2024 17:45
Solidjs + Esbuild + Deno

git clone git@gist.github.com:8aa43ff2c0f6e2632b204b0988fd2417.git

Start via deno task start

main.js builds and runs a dev server index.tsx is client entry point

@bpevs
bpevs / 冰茶.js
Last active November 19, 2023 00:37
GIVE ME TEA
const weather_to_drink_temp_map = {
'0': "正常冰",
'1': "正常冰",
'2': "少冰",
'3': "少冰",
'71': "熱",
'73': "熱",
'75': "熱",
'77': "熱",
'95': "熱",
@bpevs
bpevs / create-pls.js
Created November 8, 2022 12:49
Create VX1 .pls for bpev.me/blog/vx1 sessions
import titleCase from "https://deno.land/x/case@2.1.1/titleCase.ts";
const [dir, postDir] = Deno.args;
const contents = [];
for await (const file of Deno.readDir(dir)) {
if (file.name[0] === ".") continue;
contents.push(file);
}
@bpevs
bpevs / README.md
Last active July 29, 2022 21:01
Simple TSX App: Deno + React + Typescript

Simple TSX App: Deno + React + Typescript

The simplest Typescript + React app I could come up with. Uses Deno because the runtime has out-of-the-box support for Typescript and TSX.

Usage

You need to install Deno to run this app: https://deno.land#installation

@bpevs
bpevs / parse-unicode-emoji-list.ts
Last active June 3, 2022 01:07
Parse and build a js obj with the unicode data
// Builds obj from unicode emoji-test text
// https://unicode.org/Public/emoji/14.0/emoji-test.txt
// http://www.unicode.org/reports/tr51/
// Usage:
// deno run --allow-net fetch-emoji.ts
type Qualification = "fully-qualified" | "minimally-qualified" | "unqualified";
interface EmojiObj {
@bpevs
bpevs / README.md
Last active May 8, 2022 19:44
Small script I used to bruteforce my ethereum password

ETH Keystore Guided Bruteforce

A small script I used to bruteforce my ethereum password for a really old wallet from list of possible passphrase combinations. It did the job at that time (phew)! Originally built in node.js, I rejiggered to be a deno app so I wouldn't need to push package.json, and to make importing json files look cleaner. Replace example json files with actual files to use.

keystore.json is the wallet keystore

@bpevs
bpevs / README.md
Last active February 14, 2022 23:51
File Server Based on Standard Deno Fileserver

File Server

A basic file server, adapted from https://deno.land/std@0.125.0/http/file_server.ts The only difference is this one attempts to serve .html if there is no file extension.

Can install same as deno file_server. I like to rename to be serve:

deno install -f --allow-net --allow-read --name=serve https://gist.githubusercontent.com/ivebencrazy/de2f30bda961aeac9444de5345f68db4/raw/ff486c1206b1ee3f92514c2f8a578a8e7bbc6b45/file_server.ts

@bpevs
bpevs / wordle.ts
Last active May 8, 2022 21:20
Deno implementation of Wordle for cmd
// Deno version of Wordle
// Loosely inspired by https://gist.github.com/huytd/6a1a6a7b34a0d0abcac00b47e3d01513
//
// Run this script: deno run --allow-read wordle.ts
// Install this script: deno install --name=wordle --allow-read https://gist.githubusercontent.com/ivebencrazy/ac3c700f7d7800113c0d5d5251b0bdd8/raw/3cbf169aa7b5e59f6da033b53775085fe5d863ee/wordle.ts
import {
bgGreen,
bgWhite,
bgYellow,
@bpevs
bpevs / cjd.sh
Created February 13, 2019 16:38
# https://johnnydecimal.com/
cjd() {
if [ $# -eq 0 ]; then
cd ~/Documents
elif [ $1 =~ ['.'] ]; then
cd ~/Documents/*/*/${1}*/
elif [ $1 =~ ['-'] ]; then
cd ~/Documents/${1}*/
else
cd ~/Documents/*/${1}*/