Skip to content

Instantly share code, notes, and snippets.

View jbnunn's full-sized avatar
:octocat:

Jeff Nunn jbnunn

:octocat:
View GitHub Profile
@jbnunn
jbnunn / git-stash
Created June 4, 2014 17:57
Git 2.0 stash file for Mac OS X 10.10 Yosemite
#!/bin/sh
# Copyright (c) 2007, Nanako Shiraishi
dashless=$(basename "$0" | sed -e 's/-/ /')
USAGE="list [<options>]
or: $dashless show [<stash>]
or: $dashless drop [-q|--quiet] [<stash>]
or: $dashless ( pop | apply ) [--index] [-q|--quiet] [<stash>]
or: $dashless branch <branchname> [<stash>]
or: $dashless [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
@jbnunn
jbnunn / git-sh-setup
Created June 4, 2014 17:58
Git 2.0 setup file for Mac OS X 10.10 Yosemite
# This shell scriplet is meant to be included by other shell scripts
# to set up some variables pointing at the normal git directories and
# a few helper shell functions.
# Having this variable in your environment would break scripts because
# you would cause "cd" to be taken to unexpected places. If you
# like CDPATH, define it for your interactive shell sessions without
# exporting it.
# But we protect ourselves from such a user mistake nevertheless.
unset CDPATH
@jbnunn
jbnunn / gist:a36322c31e2efae61f36
Created February 18, 2015 21:10
Python 2.7 on Amazon Linux AMI for EC2
# install build tools
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y
# install python 2.7 and change default python symlink
sudo yum install python27-devel -y
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
# yum still needs 2.6, so write it in and backup script
sudo cp /usr/bin/yum /usr/bin/_yum_before_27
@jbnunn
jbnunn / osx-10.11-setup.md
Created December 15, 2015 04:51 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

@jbnunn
jbnunn / gist:35e8baa7edbd3e3e08b7
Last active December 22, 2015 20:46 — forked from cluePrints/gist:2521535
Installing Rails @ Amazon Linux

Steps

  • Build tools:

      sudo yum groupinstall "Development Tools"
    
  • Dependencies:

      yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel \
    

libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison iconv-devel

@jbnunn
jbnunn / Gist
Last active April 6, 2021 16:38 — forked from kurokikaze/gist:350fe1713591641b3b42
Install Google Chrome from Powershell
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)
@jbnunn
jbnunn / gist:b935ef203d6e694d90405cc433bb06f8
Last active September 24, 2019 16:56
Rekognition Indexer
'''
A trigger function for AWS Lambda that listens for object creation in an S3 bucket,
takes images, finds faces, and tags with metadata into a DDB table.
'''
import boto3
from decimal import Decimal
import json
import urllib
@jbnunn
jbnunn / seeder.py
Last active September 25, 2019 00:57
Dynamo DB Seeder
"""
This script populates a DynamoDB table with seed data. Add seeds into a JSON file, named the same as your table. Place the file in a `./seeds/` directory, e.g.,
/seeds/PetCategories.json.
The file should contain data that matches your database schema.
[
{
"petCategory": 1,
@jbnunn
jbnunn / process.py
Created October 18, 2019 16:24
Line detection in videos or images w/ Python and CV2
import os, sys
import cv2
import numpy as np
"""
Get source video, then:
1. Convert to grayscale
2. Gaussian blur
3. Detect edges