Skip to content

Instantly share code, notes, and snippets.

@smotesko
smotesko / gist:ac65667cbc748a72ecddb350d69c4e88
Last active April 4, 2024 13:03
terraformindustries.com logo with letter A fixed
Was:
_______ ______ _____ _____ ______ ____ _____ __ __ _____ _ _ _____ _ _ _____ _______ _____ _____ ______ _____
|__ __| ____| __ \| __ \ /\ | ____/ __ \| __ \| \/ | |_ _| \ | | __ \| | | |/ ____|__ __| __ \|_ _| ____|/ ____|
| | | |__ | |__) | |__) | / \ | |__ | | | | |__) | \ / | | | | \| | | | | | | | (___ | | | |__) | | | | |__ | (___
| | | __| | _ /| _ / / /\ \ | __|| | | | _ /| |\/| | | | | . ` | | | | | | |\___ \ | | | _ / | | | __| \___ \
| | | |____| | \ \| | \ \ / ____ \| | | |__| | | \ \| | | | _| |_| |\ | |__| | |__| |____) | | | | | \ \ _| |_| |____ ____) |
|_| |______|_| \_\_| \_\/_/ \_\_| \____/|_| \_\_| |_| |_____|_| \_|_____/ \____/|_____/ |_| |_| \_\_____|______|_____/
Fixed:
_______ ______ _____ _____ _ ______ ____ _____ __ __ _____ _ _ _____ _ _ _____ _______ _____ _____ ______ _____
@smotesko
smotesko / .bash_aliases
Created July 10, 2018 11:10
BTC price in bash
# requires underscore-cli https://github.com/ddopson/underscore-cli
alias btc='curl -s https://blockchain.info/ticker | underscore extract USD.15m | xargs printf "%.2f\n"'
@smotesko
smotesko / IMGvsIMG.sh
Last active September 20, 2017 19:16
Composes two images into a single image of the same size, with a slightly diagonal line between them
#! /usr/bin/env bash
set -e
STROKECOLOR="white"
STROKEWIDTHDIV=38
STROKEPOINTOFFSETDIV=25
if [ "$#" -ne 3 ]; then
echo "Usage:"
echo "$0 left_image right_image composed_image"
@smotesko
smotesko / Apple_IIe_KBD.json
Last active September 15, 2017 13:29
Apple IIe keyboard layout created on keyboard-layout-editor.com
["Esc","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","—\n–","+\n=",{w:1.5},"Del",{x:0.5},"Reset"],
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]","|\n\\"],
[{w:1.75},"Control","A","S",{n:true},"D","F","G","H","J",{n:true},"K","L",":\n;","\"\n'",{w:1.75},"Return"],
[{w:2.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:2.25},"Shift"],
["Caps Lock","~\n`",{x:1},"🍏",{a:7,w:5.5},"",{a:4},"🍎","←",{n:true},"→","↓","↑"]
@smotesko
smotesko / generate-sine.c
Created February 14, 2017 12:54
Generate sine wave
#include <stdio.h>
#include <math.h>
#define NUMBER_OF_SAMPLES 4410 // for 44100 Hz sample rate and 10Hz min f.
#define MAX_VALUE 0xFFFFFF // 24-bit samples
#define MID_VALUE (MAX_VALUE/2)
#define DC_OFFSET (MID_VALUE) // set to 0 for no offset
// Generates a wavetable (a single wavecycle) of a sine wave.
// compile: gcc -o generate-sine generate-sine.c
@smotesko
smotesko / lsusb
Last active February 14, 2017 12:56
lsusb on Mac
system_profiler SPUSBDataType
@smotesko
smotesko / blueprint
Last active February 14, 2017 12:52
create blueprint image with imagemagick
convert diagram.png -colorspace gray +level-colors white,blue blueprint.png
@smotesko
smotesko / .vimrc
Last active November 23, 2017 12:58
set number
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
syntax on
if match($TERM, "screen")!=-1
set term=xterm
endif
@smotesko
smotesko / apache-vhost-vagrant.md
Last active July 21, 2018 08:38
Apache vhost reverse proxy for using Vagrant env on a localhost:80 (Mac)
  • Configure Vagrant box to forward guest port 80 to host port 8001
  • Add vhost to your Apache:
<VirtualHost *:80>
  ServerName projectname.local
  ProxyPass / http://localhost:8001/
  ProxyPassReverse / http://localhost:8001/
  ProxyPreserveHost On
</VirtualHost>

Keybase proof

I hereby claim:

  • I am smotesko on github.
  • I am smok (https://keybase.io/smok) on keybase.
  • I have a public key whose fingerprint is D11F 088B 398C E148 EBB1 F34E 9AAE F5AB 7681 0700

To claim this, I am signing this object: