Skip to content

Instantly share code, notes, and snippets.

View BTBTravis's full-sized avatar

Travis Shears BTBTravis

View GitHub Profile
{
"first_names": {
}
}
@BTBTravis
BTBTravis / dump.py
Last active March 16, 2018 21:54
Python Script to scrape images files out of data dump including with img src base64 encoded images
#! /usr/bin/python
import re
# from base64 import decodestring
import base64
# import base64
f = open("dump.txt","r")
str = f.read()
# str = 'lalala <img src="data:image/png;base64,iVBORw0KGg"> lalala <img src="data:image/gif;base64,iVBORw0KGg">'
# str = '<img src="data:image/gif;base64,R0lGODlhPQBEAPeoAJosM//AwO/AwHVYZ/z595kzAP/s7P+goOXMv8+fhw/v739/f+8PD98fH/8mJl+fn/9ZWb8/PzWlwv///6wWGbImAPgTEMImIN9gUFCEm/gDALULDN8PAD6atYdCTX9gUNKlj8wZAKUsAOzZz+UMAOsJAP/Z2ccMDA8PD/95eX5NWvsJCOVNQPtfX/8zM8+QePLl38MGBr8JCP+zs9myn/8GBqwpAP/GxgwJCPny78lzYLgjAJ8vAP9fX/+MjMUcAN8zM/9wcM8ZGcATEL+QePdZWf/29uc/P9cmJu9MTDImIN+/r7+/vz8/P8VNQGNugV8AAF9fX8swMNgTAFlDOICAgPNSUnNWSMQ5MBAQEJE3QPIGAM9AQMqGcG9vb6MhJsEdGM8vLx8fH98AANIWAMuQeL8fABkTEPPQ0OM5OSYdGFl5jo+Pj/+pqcsTE78wMFNGQLYmID4dGPvd3UBAQJmTkP+8vH9QUK+vr8ZWSHpzcJMmILdwcLOGcHRQUHxwcK9PT9DQ0O/v70w5MLypoG8wKOuwsP/g4P/Q0IcwKEswKMl8aJ9fX2xjdOtGRs/Pz+Dg4GImIP8gIH0sKEAwKKmTiKZ8aB/f39Wsl+LFt8dgUE9PT5x5aHBwcP+AgP+WltdgYMyZfyywz78AAAAAAAD///8AAP9mZv///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@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
@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 / .vimrc
Last active July 2, 2018 18:23
my .vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic
" http://amix.dk - amix@amix.dk
"
" Version:
" 6.0 - 01/04/17 14:24:34
"
" Blog_post:
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
@BTBTravis
BTBTravis / javascript.snippets
Last active July 3, 2018 03:58
ever improving js snippets for vim
priority -50
global !p
from javascript_snippets import (
semi, space_before_function_paren, keyword_spacing
)
endglobal
###########################################################################
# Custom Snippets #
@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 / 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 / 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 / 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>