Skip to content

Instantly share code, notes, and snippets.

@BrianEnigma
BrianEnigma / .gitconfig
Last active December 31, 2015 21:49
gitconfig to show graphic lines in tig
[tig]
show-rev-graph = yes
line-graphics = no
@BrianEnigma
BrianEnigma / make_heatmap2.rb
Created January 26, 2014 01:29
Generate a kml heatmap from a csv input
#!/usr/bin/ruby
require 'csv'
HEADER = '<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<name>Puzzled Pint Heat Map</name>
'
FOOTER = ' </Document>
</kml>'
@BrianEnigma
BrianEnigma / getcomments.rb
Created February 6, 2014 00:15
Grab and locally cache comments from multiple WordPress blogs
#!/usr/bin/ruby
URL_LIST = [
'site1', 'http://example.com/comments/feed/',
'site2', 'http://example.com/comments/feed/',
'site3', 'http://example.com/comments/feed/',
]
position = 0
while position < URL_LIST.length
### Keybase proof
I hereby claim:
* I am BrianEnigma on github.
* I am brianenigma (https://keybase.io/brianenigma) on keybase.
* I have a public key whose fingerprint is 489B 9421 9947 C5C3 48A8 7601 E1EB D30D 8174 A623
To claim this, I am signing this object:
rotate_extrude($fn=100)
{
difference()
{
polygon(points = [
[0,0], // origin
[15,0], // base radius
[13,6], // bottom lip
[30,34], // top lip
[30,40], // top radius
@BrianEnigma
BrianEnigma / auth_curl.sh
Created August 27, 2015 20:35
Test script to auth against an Elemental box
#!/bin/bash
#URL=/live_events?filter=archived
URL=/live_events
USER=admin
KEY=1acpJN7oEDn3BDDYhQ
NOW=`date +%s`
EXPIRES=$(expr $NOW + 30)
SUBHASH=`echo -n "$URL$USER$EXPIRES" | md5`
HASH=`echo -n "$KEY$SUBHASH" | md5`
@BrianEnigma
BrianEnigma / static_ffmpeg_build.sh
Last active April 19, 2017 22:36
Build a 100% static version of a modern ffmpeg
# This script now lives in the following repository: https://github.com/BrianEnigma/StaticBinaries
$ ./videorekognize.rb --extract-period 60 ~/Desktop/Sintel.2010.1080p.mkv
Extracting video frames...
Extracted 16 video frames
Cleaning up stale S3 objects...
Uploading img00001.png...
Uploading img00002.png...
Uploading img00003.png...
Uploading img00004.png...
Uploading img00005.png...
Uploading img00006.png...
@BrianEnigma
BrianEnigma / process.sh
Created May 9, 2021 15:22
Extract segments from Star Wars Biomes as clips for a screensaver
#!/bin/bash
INFILE=biomes.mp4
# Check that infile exists
stat $INFILE >/dev/null 2>&1 || { echo "Expect $INFILE in the current folder. Aborting." >&2; exit 1; }
# Check that ffmpeg exists
command -v ffmpeg >/dev/null 2>&1 || { echo "I require ffmpeg but it's not installed. Aborting." >&2; exit 1; }
#!/usr/bin/env python3
import drawsvg as dw
# requirements.txt:
# drawsvg
# cairosvg
WIDTH = 25 # millimeters
HEIGHT = 30 # millimeters
CORNER_RADIUS = 4 # millimeters