Skip to content

Instantly share code, notes, and snippets.

Garth Mortensen voldemortensen

Block or report user

Report or block voldemortensen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@voldemortensen
voldemortensen / reactdocs.py
Created Aug 2, 2019
Put the React docs in your iTerm2 toolbelt.
View reactdocs.py
#!/usr/bin/env python3.7
import asyncio
import iterm2
async def main(connection):
await iterm2.tool.async_register_web_view_tool(connection,
"React Docs",
"com.iterm2.react-docs",
False,
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Async Save Example</title>
<style>
.btn {
color: white;
padding: 0.5rem 1rem;
border-radius: 5%;
@voldemortensen
voldemortensen / run-jitbit.js
Created Jun 18, 2019
Runs the jitbit ssl check automatically if form is filled.
View run-jitbit.js
// ==UserScript==
// @name Run JitBit SSLCheck
// @namespace https://www.jitbit.com/sslcheck/
// @version 0.1
// @description Run's the jitbit ssl checker automatically if form is filled out.
// @author You
// @match https://www.jitbit.com/sslcheck/
// @grant none
// ==/UserScript==
View editstuff.pl
#!/usr/bin/env perl
use strict;
use warnings;
use File::Temp qw/tempfile/;
use Env qw/EDITOR/;
my ($fh, $filename) = tempfile();
print $fh <<EOF
A file
View history.txt
stackoverflow.com
docs.docker.com
docs.ansible.com
php.net
developer.apple.com
metacpan.org
developer.mozilla.org
www.hammerspoon.org
www.slimframework.com
www.manualslib.com
@voldemortensen
voldemortensen / 1.js
Created Apr 5, 2019
JavaScript30.com Day 1 Challenge
View 1.js
document.addEventListener('keydown', e => {
let key = e.keyCode;
let square = document.querySelector('div[data-key="'+key+'"]');
let sound = document.querySelector('audio[data-key="'+key+'"]');
if (square && sound) {
square.classList.add('playing');
sound.currentTime = 0;
sound.play();
setTimeout(() => {
@voldemortensen
voldemortensen / song.sh
Created Mar 24, 2019
SoX version of The Forgotten, Part I by Joe Satriani
View song.sh
#!/bin/bash
play -qn -t alsa synth 0.05 trapezium C4 trapezium G4 channels 1
play -qn -t alsa synth 0.05 trapezium C4 channels 1
play -qn -t alsa synth 0.05 trapezium C4 trapezium G4 channels 1
play -qn -t alsa synth 0.05 trapezium C4 channels 1
play -qn -t alsa synth 0.05 trapezium C4 trapezium G4 channels 1
play -qn -t alsa synth 0.05 trapezium C4 channels 1
play -qn -t alsa synth 0.05 trapezium C4 channels 1
play -qn -t alsa synth 0.05 trapezium C4 trapezium G4 channels 1
@voldemortensen
voldemortensen / keyboard.c
Created Mar 11, 2019
Send a random keystroke (A-Z) then wait a random period of time (up to 5 minutes).
View keyboard.c
#include "DigiKeyboard.h"
void setup() {}
void loop() {
DigiKeyboard.sendKeyStroke(0);
char randomLetter = 'A' + (rand() % 26);
DigiKeyboard.println(randomLetter);
View gist:1c8f2413ca399ce429f6cb3722936054
const express = require('express');
const app = express();
const port = 3000;
let someFunction = () => {
console.log('hit someFunction');
throw new Error('err');
};
app.get('/', async (req, res) => {
@voldemortensen
voldemortensen / boxstarter.ps1
Last active Jan 31, 2019
Setup a Windows 10 machine
View boxstarter.ps1
# Description: Boxstarter Script
# Author: Garth Mortensen
# Last Updated: 2019-29-01
#
# Large portions taken from:
# https://gist.github.com/jessfraz/7c319b046daa101a4aaef937a20ff41f
# and
# https://gist.github.com/NickCraver/7ebf9efbfd0c3eab72e9
#
# Install boxstarter:
You can’t perform that action at this time.