Skip to content

Instantly share code, notes, and snippets.

View scoutman57's full-sized avatar

Shannon Warren scoutman57

View GitHub Profile
@Artistan
Artistan / a ngrok_background.sh
Last active February 23, 2024 22:02 — forked from rjz/ngrok_hostname.sh
Get ngrok hostname from command line
#!/bin/sh
########################################################################################
# I do not need to use the ngrok subdomains...
# start ngrok for my local box (vagrant homestead) in th background
# get the cname from command line for the ngrok alias
# update my subdomain cname to point at new ngrok name
# use it!!!
########################################################################################
# requires ngrok and jq installed.
@t-io
t-io / osx_install.sh
Last active October 22, 2023 13:04
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@robmiller
robmiller / .gitconfig
Created July 17, 2013 07:52
Some useful Git aliases that I use every day
#
# Working with branches
#
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
@oodavid
oodavid / README.md
Created April 12, 2012 20:01
MySQL - Group by grid-square

MySQL - Group by grid-square

Inspired by the police.uk crime maps, where they cleverly cluster data together depending on how far zoomed in you are, this MySQL snippet goes a long way to explaining the logic behind such an operation.

A perfect grid

This snippet groups sites to a perfect grid while the police.uk algorithm has some sort of trickery that moves their points about somewhat, looking at their blogs and documentation I would conclude that they have a predefined set of points, each with a catchment area of postcodes. It looks like a whole lot of scraping and manual labour went into their database and quite frankly I don't have the time nor inclination do attempt such a task.

Example

@oodavid
oodavid / README.md
Created April 9, 2012 21:41
Sync ./uploads/ with Amazon S3

Sync ./uploads/ with Amazon S3

This is a simple way to Sync a folder with Amazon S3 for a nightly backup - this is all to be done on your server :-)

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

# Install s3cmd

cd /etc/yum.repos.d/