Skip to content

Instantly share code, notes, and snippets.

View mintbridge's full-sized avatar

Paul Dixon mintbridge

  • MintBridge
  • Newcastle
View GitHub Profile
#!/bin/bash
apt-get update
#Additional Packages
apt-get install -y keyutils unzip php5-ldap php5-mssql zsh
#PHP OCI8 Driver
#Putting the cart before the horse here, but it leaves the only interactive part for the end.
@mintbridge
mintbridge / auto-pair-back-ticks.sublime-keymap
Created October 26, 2013 10:21
Sublime Text key bindings for auto pairing back ticks (`), useful for SQL queries
// Auto-pair back ticks
{ "keys": ["`"], "command": "insert_snippet", "args": {"contents": "`$0`"}, "context":
[
{ "key": "setting.auto_match_enabled", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^(?:\t| |\\)|]|\\}|>|$)", "match_all": true },
{ "key": "preceding_text", "operator": "not_regex_contains", "operand": "[`a-zA-Z0-9_]$", "match_all": true },
{ "key": "eol_selector", "operator": "not_equal", "operand": "string.quoted.single", "match_all": true }
]
},
# convert the version for each pdf in a directory and put them in a sub folder of output
for input in *.pdf; do gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile="output/$input" "$input"; done;
@mintbridge
mintbridge / gist:3756016
Created September 20, 2012 13:45
Useful Git Commands
git branch:
--merged is used to find all branches which can be safely deleted, since those branches are fully contained by HEAD.
--no-merged is used to find branches which are candidates for merging into HEAD, since those branches are not fully contained by HEAD.
@mintbridge
mintbridge / remove-packages.sh
Last active October 6, 2015 16:48
Ubuntu Config
#!/bin/bash
#script to remove some of the default (un-needed/un-used) packages from ubuntu
sudo apt-get purge rhythmbox aisleriot mahjongg thunderbird*
@mintbridge
mintbridge / Grunt.sublime-build
Created June 30, 2012 11:36
Sublime Text 2 - Settings, plugins and snippets
{
"cmd": ["grunt", "develop"],
"selector": ["source.js", "source.less", "source.json"],
"path": "/usr/bin"
}
window.onload = function(e) {
alert('hiya');
}
/*******
*** Anchor Slider by Cedric Dugas ***
*** Http://www.position-absolute.com ***
Never have an anchor jumping your content, slide it.
Don't forget to put an id to your anchor !
You can use and modify this script for any project you want, but please leave this comment as credit.
#!/bin/sh
# have submodules been added?
MODS=0
# Github base URL
GITHUB="https://github.com"
# Default branch
DEFAULT_BRANCH="3.0/master"
/*
function to create the sql for finding the distance between 2 lat/lng pairs
*/
//$unit = '6367.45';
//$unit = '3978';
function distance($lat_from, $lng_from, $lat_to, $lng_to, $unit = '3978') {
return ‘ROUND($unit * acos(sin(‘.$lat_from.’) * sin(‘.$lat_to.’) + cos(‘.$lat_from.’) * cos(‘.$lat_to.’) * cos(‘.$lng_from.’ - ‘.$lng_to.’)))’;
}
//Use it like this: