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:18 (UTC -06:00)
View GitHub Profile
@bpevs
bpevs / simpleScraper.js
Last active August 29, 2015 14:17
A Simple Hacker News Scraper
//Include our Libraries!
var request = require('request');
var cheerio = require('cheerio');
//Request will send our web request to Hacker News
request('https://news.ycombinator.com', function (error, response, body) {
//continue with our scraper if there's no errors
if (!error && response.statusCode == 200) {
@bpevs
bpevs / yourSnippetsNameHere.sublime-snippet
Last active August 29, 2015 14:17
The screen that pops up to build a new sublime text snippet
<!-- This is the screen that pops up when you try to make a snippet -->
<!-- replace "yourtext" with whatever you want your expanded text to be -->
<!-- replace "yourkey" with the keyword you want to use to trigger it -->
<snippet>
<content><![CDATA[yourtext]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>yourkey</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
@bpevs
bpevs / staticNodeServer.js
Last active August 29, 2015 14:17
A simple Node.js server for static files.
// Declare our dependencies.
var http = require('http');
var url = require('url');
var path = require('path');
var fs = require('fs');
// The function we run on every incoming message
var serverCallback = function(incomingMessage, response) {
// Get the location of our file
@bpevs
bpevs / simpleStaticExpressServer.js
Last active August 29, 2015 14:17
A simple Express server for static files
var express = require('express');
var app = express();
app.use(express.static(__dirname + '/public'));
app.listen(process.env.PORT || 3000);
@bpevs
bpevs / FreshInstall.md
Last active November 15, 2021 06:41
A list of stuff I use on a fresh reinstall
@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}*/
@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 / 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 / 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 / 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 {