Skip to content

Instantly share code, notes, and snippets.

View billyxs's full-sized avatar

Billy Montgomery billyxs

View GitHub Profile
@billyxs
billyxs / osx_brew_cask_installs.sh
Last active April 29, 2018 05:44
Install Homebrew, Cask, and necessary apps for Mac OSX
#!/bin/sh
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Development
brew install node
brew install go
brew install dep # dep manager for go
brew install python3
@billyxs
billyxs / npm_globals_install_osx.sh
Last active April 19, 2018 18:30
Install NPM global modules for OSX
#!/bin/ssh
# message colors
GREEN='\033[0;32m'
CYAN='\033[0;36m'
NONE='\033[0m'
# npm it
# Install Dev Tools - Express, React, Bower, Nodemon, Node Inspector
@billyxs
billyxs / gist:25572da8cb6cb1fd143f
Last active August 29, 2015 14:06
iOS - Create dictionary from escaped JSON string
NSDictionary *data =
[NSJSONSerialization JSONObjectWithData: [@"{\"a\":\"A\", \"b\":\"B\"}" dataUsingEncoding:NSUTF8StringEncoding]
options: NSJSONReadingMutableContainers
error: nil];
@billyxs
billyxs / simulator-link.sh
Last active August 29, 2015 14:03
iPhone/iPad Simulator Link
@billyxs
billyxs / directive.onenter.js
Last active August 29, 2015 14:02
Angular - On Enter Keypress Directive
app.directive('xs-enter', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress", function (event) {
event.preventDefault();
if(event.which === 13) {
scope.$apply(function (){
scope.$eval(attrs.xsEnter);
});
}
});
@billyxs
billyxs / get-mouse-event-position.js
Last active August 29, 2015 14:02
Get Mouse Event Position
function(e) {
if(!e) var e = window.event;
var posx = 0;
var posy = 0;
if (e.pageX || e.pageY) {
posx = e.pageX;
posy = e.pageY;
}