Skip to content

Instantly share code, notes, and snippets.

View fprimex's full-sized avatar

Brent Woodruff fprimex

View GitHub Profile
@fprimex
fprimex / gist:e6339794226037762105
Last active August 29, 2015 14:06
Get started with evaluating zdeskcfg
(Install Python 2.x at least and optionally set up virtualenv)
mkvirtualenv zdeskcfg
pip install zdeskcfg
wget https://raw.githubusercontent.com/fprimex/zdeskcfg/master/example
./example -h
@fprimex
fprimex / testawk.awk
Created January 19, 2015 20:56
Demonstrate AWK bug on OS X.
BEGIN {
string1 = "[couchdb:info,2014-04-22T22:30:04.873,ns_1@node:<0.6548.6>:couch_log:info:39]164.55.92.41 - - GET /default/_design/v6/_view/v6_sizes?group=true&group_level=1 500"
string2 = "[couchdb:info,2014-06-15T6:30:06.928,ns_1@node:<0.3037.5064>:couch_log:info:39]164.55.92.41 - - GET /default/_design/v6/_view/v6_sizes?group=true&group_level=1 200"
match(string1, /_view\/[_[:alnum:]]+/)
view = substr(string1, RSTART, RLENGTH)
print view
match(string2, /_view\/[[:alnum:]_]+/)
view = substr(string2, RSTART, RLENGTH)
@fprimex
fprimex / python-cython-c.md
Created February 24, 2017 14:58
Python Cython C talk abstract

Bridging Python to C with Cython for speed and flexibility

Python is an accessible, productive general purpose programming language. It is also interpreted and, at times, cannot match the raw speed and performance of compiled languages such as C, C++, and Fortran. This talk will demonstrate a practical and easy approach to working in Python, identifying runtime bottlenecks, and converting those hotspots to C. The end result is Python that can easily access compiled C code, allowing for the combination of the ease of Python with the speed and flexibility of C.

package main
import (
"fmt"
"log"
"github.com/fprimex/zdesk-go"
"github.com/tidwall/gjson"
)
@fprimex
fprimex / bday
Created September 25, 2017 20:31
Happy Birthday AWK!
awk 'BEGIN {X=" \xF0\x9F";A=T=X "\x8E\x87";P=D=X "\x92\xA5";H=Y=X "\x8E\x86";B=R= X "\x95\xAF";I=X "\x8E\x82"
printf "\n" H A P P Y B I R T H D A Y "\n\n"}'
@fprimex
fprimex / arrows
Last active October 13, 2017 20:39
Pac Man
Level 1
β†’ ↑ ← ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ← ↑ ↑ ↑ β†’ ↓ ← ↓ β†’ ↑ β†’ β†’ ← ↑ ↓ ← ← β†’ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ← ↑ ↑ ↑ β†’ ↓ ← ↓ β†’ ↓ ← ↓ β†’ ↓ ← ↓ ↑ β†’ β†’ ← ↑ ↓ ← ← β†’ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ↑ β†’ β†’ ← ↑ ↓ ← ← β†’ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ↓ ↑ β†’ β†’ ← ↑ ← ↑ ↓ ← ← β†’ ↓ β†’ ↑ ← β†’ πŸ’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ↓ ↑ β†’ β†’ ↓ β†’ ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ← ↑ ↑ ↑ β†’ ↓ ← ↓ β†’ ↓ ← ↓ β†’ ↓ ← ↓ ↑ ← ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ← ↑ ↑ ↑ β†’ ↓ ← ↓ β†’ ↑ β†’ β†’ ← ↑ ↓ ← ← β†’ ↓ β†’ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ↑ β†’ β†’ ← ↑ ↓ ← ← β†’ ↓ β†’ ↑ ← β†’ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ↑ β†’ β†’ ← ↑ ↓ ← ← β†’ ↓ β†’ ↑ ← β†’ ↓ ↑ β†’ β†’ ← ↑ ↓ ← ← β†’ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ↑ β†’ β†’ ← ↑ ↓ ← ← β†’ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ↓ ↑ β†’ β†’ ← ↑ ← ↑ ↓ ← ← β†’ ↓ β†’
Level 2
← ↑ ← ↑ β†’ ← ↓ ← ← ↑ ↑ ↑ β†’ ↓ ← ↓ β†’ ↑ β†’ β†’ ← ↑ ↓ ← ← β†’ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ← ↑ ↑ ↑ β†’ ↓ β†’ ← ↓ ↑ β†’ β†’ ← ↑ ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ← ↓ ← ← ↑ ↑ ↑ β†’ ↓ ← ↓ β†’ ↓ ← ↓ β†’ ↓ ← ↓ ↑ ← ↓ β†’ ↑ ← β†’ ↓ ↑ ↑ ← ↑ β†’ ←
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <path_to_content_directory> <organization>/<workspace>"
exit 0
fi
CONTENT_DIRECTORY=$1
ORG_NAME="$(cut -d'/' -f1 <<<"$2")"
WORKSPACE_NAME="$(cut -d'/' -f2 <<<"$2")"
@fprimex
fprimex / tfe-push.sh
Last active February 17, 2018 16:34 — forked from skierkowski/tfe-push.sh
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <path_to_content_directory> <organization>/<workspace>"
exit 0
fi
CONTENT_DIRECTORY=$1
ORG_NAME="$(cut -d'/' -f1 <<<"$2")"
WORKSPACE_NAME="$(cut -d'/' -f2 <<<"$2")"