Skip to content

Instantly share code, notes, and snippets.

View dtschust's full-sized avatar

Drew Schuster dtschust

View GitHub Profile
#!/usr/bin/env node
require('dotenv').config();
const Twit = require('twit');
const yourScreenName = 'nuncamind';
const T = new Twit({
consumer_key: process.env.TWITTER_CONSUMER_KEY,
consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
@dtschust
dtschust / fillIndexedDB.js
Created February 26, 2021 22:37
fill up indexedDB with at least 2 gigs of junk
var one = new Array(267386880/2 - 1000).join('a')
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
@dtschust
dtschust / go.sh
Last active December 8, 2020 01:08
Change mac app icon programatically
#!/bin/sh
# I believe you need XCode installed to get sips/Rez/SetFile
# Have an Icon.png in the current working directory
# Resize it to 512 by 512 for some reason
sips -z 512 512 Icon.png --out myIconResized.png
# make it an .icns file
sips -s format icns myIconResized.png --out myIcon.icns

Put in ~/Library/LaunchAgents.

launchctl load drew.screenshot.plist

@dtschust
dtschust / Hacky Twitter => Mastodon Bridge Writeup.md
Created August 28, 2018 12:53
A brief writeup of my hacky twitter mastodon bridge

repo is here https://github.com/dtschust/fake-mastodon-instance/tree/c858a0d9427efc9c16a1c73bfcc0545bbdacb343

Best place to start looking is src/index.js, which is the express server that acts as a Mastodon instance.

In order to mirror a user from another service in a way that Mastodon recognizes, you must implement the following:

@dtschust
dtschust / Salmon.md
Last active November 17, 2017 22:14
Salmon recipe

Salmon recipe:

Ingredients

12 oz for two people: 0.75 pounds. The Norway atlantic salmon fillet at Whole Foods that’s $9.99 a pound

Steps

  • Rinse salmon and pat all sides with paper towel, cut fillets in half
  • Put salt and pepper on salmon
  • Sit out for 30 minutes
  • At 15 minutes, preheat oven to 400 degrees Fahrenheit
  • At 25 mins, start heating skillet (high heat, about a 6)
@dtschust
dtschust / .hyper.js
Last active October 26, 2017 16:35
hyper config
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Monaco, "Roboto Mono for Powerline", Monaco, Menlo, "DejaVu Sans Mono", "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(248,28,229,0.8)',
(function() {
var script = document.createElement('script')
script.onload = function() {
var stats = new Stats()
stats.showPanel(1)
document.body.appendChild(stats.dom)
requestAnimationFrame(function loop() {
stats.update()
requestAnimationFrame(loop)
})

Keybase proof

I hereby claim:

  • I am dtschust on github.
  • I am dtschust (https://keybase.io/dtschust) on keybase.
  • I have a public key whose fingerprint is 1BF9 1040 5E2D 3644 CA92 4298 6A13 3FDD 55F3 FF82

To claim this, I am signing this object:

@dtschust
dtschust / 0_reuse_code.js
Created August 6, 2016 18:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console