Skip to content

Instantly share code, notes, and snippets.

View BTBTravis's full-sized avatar

Travis Shears BTBTravis

View GitHub Profile
@BTBTravis
BTBTravis / com.twtxt.agent.plist
Created May 31, 2020 21:35
Twtxt S3 Uploader
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.twtxt.agent</string>
<key>Program</key>
<string>/Users/t.shears/play/twtxt-tools/upload_twtxt.pl</string>
<key>RunAtLoad</key>
<true/>
@BTBTravis
BTBTravis / DemoApp.svelte
Created May 2, 2020 11:16
Simple Input Demo App Written in Svelte
<script>
let name = 'travis shears';
</script>
<div class="svelte-demo-app">
<div class="input-group">
<label>Bound input:</label>
<input bind:value={name}>
</div>
<div>
@BTBTravis
BTBTravis / Dev.pm
Created April 24, 2020 09:16
Perl Bless Example
#!/usr/bin/env perl
use strict;
use warnings;
require Utils;
package Dev;
sub new {
@BTBTravis
BTBTravis / backup.js
Created April 23, 2020 16:45
Backup Random Wiki Articles
const backupJSON = [{ "title": "Tombstone (typography)", "description": "Symbol used in mathematics and typography", "img": "https://upload.wikimedia.org/wikipedia/commons/3/3e/Halmos_symbols.png" }, { "title": "The Execution of All Things", "description": "2002 studio album by Rilo Kiley", "img": "https://upload.wikimedia.org/wikipedia/en/5/5b/Rilo_Kiley_-_The_Execution_Of_All_Things.jpg" }, { "title": "2014 Illinois State Redbirds football team", "description": "American college football season", "img": "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Illinois_State_Redbirds_Wordmark.png/320px-Illinois_State_Redbirds_Wordmark.png" }, { "title": "Market garden", "description": "relatively small-scale production of fruits, vegetables and flowers as cash crops", "img": "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/PK_fields_by_water1.jpg/320px-PK_fields_by_water1.jpg" }, { "title": "Sister Christian", "description": "1984 single by Night Ranger", "img": "https://upload.wikimedia.org/wiki
@BTBTravis
BTBTravis / index.html
Created April 23, 2020 14:46
Lesson 7 Arrays Starter Boilerplate
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>lesson 7 arrays</title>
</head>
<body>
<script src="https://travisshears.com/apps/random-wiki/0.0.4--alpha3/src.7b19814e.js"></script>
@BTBTravis
BTBTravis / calc.css
Created April 15, 2020 14:57
Lesson 4 Classwork -- Addition Calculator
.mainArea {
--lightBlue: #BACBFF;
font-family: 'Roboto Mono', monospace;
background: var(--blue);
overflow: hidden;
height: 100vh;
margin: 0;
min-height: 100vh;
display: grid;
@BTBTravis
BTBTravis / sort_tasks.pl
Last active June 3, 2019 19:22
sort tasks vimwiki
#!/usr/bin/perl
use strict;
use warnings;
my @done_tasks;
my @todo_tasks;
my $todo_type = "todo";
my $done_type = "done";
my $last_task_type = "none";
my $has_cacled_indent = 0;
@BTBTravis
BTBTravis / sopen.sh
Created May 27, 2019 14:16
sopen -- unix util
#!/usr/bin/env bash
I=0
FILES=()
while read line ; do
echo "$I" "$line"
FILES+=($line)
let "I++"
done
@BTBTravis
BTBTravis / sudoku.js
Created April 25, 2018 20:07
Technical challenge @ LiveIntent
/*
* The validate method returns `true` if the entire sudoku table is valid, `false` otherwise.
* Expected input for this function is a variable number of Arrays, where each array
* represents one row of a sudoku table.
*
* For example you could expect something like this for a valid table:
*
* [
* [2,9,5,7,4,3,8,6,1],
* [4,3,1,8,6,5,9,2,7],
@BTBTravis
BTBTravis / makegif.sh
Created March 29, 2018 16:46
Bash script to make quick gifs from .mov files captured with quicktime screen recording
#!/bin/sh
MOV_NAME="$1"
ffmpeg -i ${MOV_NAME}.mov -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=2 > ${MOV_NAME}.gif
echo "BOOM HERE IS A ${MOV_NAME}.gif"
read -p "Open in chrome? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
open -a Google\ Chrome ${MOV_NAME}.gif
fi