Skip to content

Instantly share code, notes, and snippets.

View rugbyprof's full-sized avatar

Terry Griffin rugbyprof

View GitHub Profile
@rugbyprof
rugbyprof / exif.php
Last active February 14, 2020 02:03
meta data from images php
#!/usr/bin/php -q
<?php
/*
* exif.php
* This script gets meta headers from image files.
*
* (For use with command line)
* Usage Usage: php exif.php <image>
* Example: php exif.php beach.jpg
@rugbyprof
rugbyprof / file.swift
Last active February 14, 2020 02:14 — forked from frozzare/file.swift
swift example
import Foundation
class File {
class func exists (path: String) -> Bool {
return NSFileManager().fileExistsAtPath(path)
}
class func read (path: String, encoding: NSStringEncoding = NSUTF8StringEncoding) -> String? {
if File.exists(path) {
@rugbyprof
rugbyprof / index.js
Created June 28, 2016 04:03 — forked from max-mapper/index.js
cave generator
var observer = require('continuous-observer')
var cave = require('cave-automata-2d')
var fill = require('ndarray-fill')
var zero = require('zeros')
var raf = require('raf')
var canvas = document.createElement('canvas')
var ctx = canvas.getContext('2d')
// Set up the controls, so that we can control
@rugbyprof
rugbyprof / README.md
Created July 11, 2016 22:46 — forked from chrisjacob/README.md
Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout - a step-by-step guide.

Intro

Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout.

IMPORTANT

If you plan on switching between different branches (e.g. git checkout master-experiment then revert back with git checkout master) you will loose your child folder from this tutorial (because it's in your .gitignore and is not part of your master branch).

@rugbyprof
rugbyprof / mapoverlay.py
Created July 2, 2017 18:54 — forked from cpatdowling/mapoverlay.py
A native python 2.7+ class that projects WSG84 latitude/longitude coordinates to pixel positions in a Web Mercator map image with known coordination.
#Example usage
"""
upleft = [47.6197793,-122.3592749] Upper left coordinate of map image
bttmright = [47.607274, -122.334786] Lower right coordinate of map image
imgsize = [1135,864] Pixel size of map image
mp = MapOverlay(upleft, bttmright, imgsize)
#then given a list of latitude/longitude pairs , we can get their relative positions on the image of the map, note
#that image pixel positions start with (0,0) at the top left of the image, so plotting will require inverting the y-axis
@rugbyprof
rugbyprof / earthquake.js
Last active July 7, 2021 06:04 — forked from shiffman/earthquake.js
earthquake.js
// https://api.mapbox.com/styles/v1/mapbox/streets-v8/static/0,0,2/600x600?access_token=
var mapimg;
var zoom = 1;
var data;
var ww = 900;
var hh = 900;
var clat = 0; //37.7749;
var clon = 0; //-122.4194;
@rugbyprof
rugbyprof / ml_ubuntu_setup.sh
Last active September 6, 2017 19:57 — forked from anonymous/ml_ubuntu_setup.sh
Shell to install appropriate machine learning packages (and other stuff) for some vagrant linux box
#!/usr/bin/env bash
# Add repo for sublime text
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
# Update apt-get
sudo apt-get update
# Zsh
@rugbyprof
rugbyprof / install_all.sh
Last active August 23, 2021 03:40 — forked from anonymous/install_all.sh
Installation script #sh
#!/bin/bash
# Install script for my personal machine
echo "Installing xcode...\n"
#command line install for xcode
xcode-select --install
echo "Installing homebrew...\n"
# Install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@rugbyprof
rugbyprof / .bash_profile
Created October 3, 2018 22:10 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management