Skip to content

Instantly share code, notes, and snippets.

View tylerbuchea's full-sized avatar
💭
Hello World!

Tyler tylerbuchea

💭
Hello World!
View GitHub Profile
@tylerbuchea
tylerbuchea / JSKeyCodes
Created December 17, 2013 19:58
List of JavaScript key codes.
backspace 8
tab 9
enter 13
shift 16
ctrl 17
alt 18
pause/break 19
caps lock 20
escape 27
page up 33
[
"238TiUaK4b7wz25gHsLggtz2zSafERYybA5xoxNr4SHv",
"25Zbxtk92esi9wU92zqkziFrzSwDkaLauJ5JqSkbhau1",
"26dy98GpZjVqzaY7LSPqjvHDtriJrBUv9Zi2zTqTDQwy",
"26qqFE98F3Md2rw6aTeZTJXmKJFjGBRFHxLq7u6D1ivg",
"27VD5AJkkp3Q7UqXsMzHJ8jUAhGmCdU46RYTFhTvB8ac",
"29KDfJZVvDWt8TMMbepd7henJhTtbqb5fhPRPYJZ6K7B",
"29kQg4izNqtN1r8svkTKWnyTHrGghX5UnRSGNkUALY6h",
"2AQjfRZkHJn9P6w99RFMUCcXwNRJPnf7t6zF9FiLdmSP",
"2CrNZQWY4mjyUzd3Jyc8GF9qFppwdpoWPoapw3jB3Kpk",
This file has been truncated, but you can view the full file.
[
{
"crawl_id": "1454131228142735360",
"mint": "EXdJDLGeQfXaLd5MXcq2PcDLbtqn8iFJiz6GdgRhfjeb",
"name": "ChickenTribe #69",
"image": "https://weaver.moonrank.app/psRI5_E2ikK9qYKR0zrw4L_XQ8GgG3NFa6CSuZ0Crd8?ext=png",
"created": 1635526805,
"rank": 1,
"rarity": 5.080526342529085e-32,
"rank_explain": [
@tylerbuchea
tylerbuchea / digital-ocean-ghost-blog-update.md
Last active March 6, 2020 04:45
Digital Ocean Ghost Blog Update

I used Digital Ocean's One-Click install for Ghost blog some time ago and then I wanted to update it. It ended up being more work then I'd hoped so hopefully this helps someone.

If you get locked out

# If you get locked out of your droplet:
# 1. upload your ~/.ssh/id_rsa.pub file to Dropbox
# 2. Then reset Digital Ocean root password
# 3. Login through the Digital Ocean web console using new password
@tylerbuchea
tylerbuchea / textNodesUnder.js
Last active November 23, 2019 15:07
Get all text values under a specific node
function textNodesUnder(node){
const all = [];
for (node = node.firstChild; node; node = node.nextSibling){
if (node.nodeType === 3) all.push(node);
else all = all.concat(textNodesUnder(node));
}
return all;
}
let selector = '';
@tylerbuchea
tylerbuchea / example.js
Created May 18, 2019 03:37 — forked from nicolashery/example.js
Combine a pipe of multiple Node.js streams into one stream
var util = require('util')
, Transform = require('stream').Transform
, StreamCombiner = require('./streamcombiner');
var chunks1 = [];
var stream1 = new Transform();
var soFar = '';
stream1._transform = function(chunk, encoding, done) {
chunks1.push(chunk.toString());
var pieces = (soFar + chunk).split('\n');
@tylerbuchea
tylerbuchea / optimizedScroll.js
Created July 29, 2015 22:39
The JavaScript scroll event isn't very peformant this MDN snippet fixes that with a modified event.
(function() {
'use strict';
var throttle = function(type, name, obj) {
obj = obj || window;
var running = false;
var func = function() {
if (running) { return; }
running = true;
obj.requestAnimationFrame(function() {
obj.dispatchEvent(new CustomEvent(name));
@tylerbuchea
tylerbuchea / cloudSettings
Last active August 29, 2018 15:24
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-08-29T15:24:17.471Z","extensionVersion":"v3.1.0"}
@tylerbuchea
tylerbuchea / cmd.sh
Created June 30, 2017 18:02 — forked from kelvinn/cmd.sh
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/