Skip to content

Instantly share code, notes, and snippets.

View bingeboy's full-sized avatar
🏠
Working from home

JP McGarrity bingeboy

🏠
Working from home
View GitHub Profile
@bingeboy
bingeboy / Mac OSX Key Strokes
Last active June 3, 2022 21:06
List of Mac OSX Key Strokes, shortcut symbol meanings.
⌘ Command
⌥ Option
⇧ Shift
⌃ Control
⌫ Backward Delete
⌦ Forward Delete
⎋ Escape
 Eject
fn Fn Key
F1 Function
@bingeboy
bingeboy / Geolocation Javascript
Last active August 6, 2021 11:07
Geolocation Detection in browser with Javascript snippet.
var success = function(locationData){
console.log("locationData object", locationData);
},
error = function(err){
console.log(err);
};
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(success, error, 10000);
} else {
@bingeboy
bingeboy / Dom2 Event Example
Created May 5, 2013 15:34
Dom2 Event Example
<html>
<head>
<title>Basic Dom2 Event Handler And Bubble Test</title>
</head>
<body>
<div id="container">
<ul id="listContainer">
<li id="item1">item1</li>
<li id="item2">item2</li>
</ul>
@bingeboy
bingeboy / Example: Function for Event Listener
Created May 5, 2013 18:46
JavaScript Event Listener with CSS3 Webkit Animations
function cssAnimationEnd() {
element.addEventListener('webkitAnimationEnd', function (event) {
console.log("Finished animation!");
}, false );
};
@bingeboy
bingeboy / bash commands
Last active December 17, 2015 02:29
Common Bash Commands I always forget.
#On going list of bask commands that I always forget.
#Dropbox symlink for .bash_profile
$ln -s Dropbox/MacSetings/.bash_profile ~/.bash_profile
#Symbolic Link:
ln -s [TARGET DIRECTORY OR FILE] ./[SHORTCUT]
#Tail mongodb:
tail -f /usr/local/var/log/mongodb/mongo.log
@bingeboy
bingeboy / app.js
Last active April 29, 2021 15:52
Upload and display image with NodeJS and Express.
/*
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, common = require('./routes/common')
, fs = require('fs')
, http = require('http')
, util = require('util')
@bingeboy
bingeboy / gist:5601141
Last active December 17, 2015 11:19
Playing with Object.keys();
~ $node
> var x= {"glossary":{"title":"example glossary","GlossDiv":{"title":"S","GlossList":{"GlossEntry":{"ID":"SGML","SortAs":"SGML","GlossTerm":"Standard Generalized Markup Language","Acronym":"SGML","Abbrev":"ISO 8879:1986","GlossDef":{"para":"A meta-markup language, used to create markup languages such as DocBook.","GlossSeeAlso":["GML","XML"]},"GlossSee":"markup"}}}}}
undefined
> x.glossary.GlossDiv.GlossList.GlossEntry
{ ID: 'SGML',
SortAs: 'SGML',
GlossTerm: 'Standard Generalized Markup Language',
Acronym: 'SGML',
Abbrev: 'ISO 8879:1986',
@bingeboy
bingeboy / gist:5605289
Created May 18, 2013 17:59
Module with public functions... good start for modules.
Var Roll = {} || Roll;
Roll.api = (function(){
//private
var _private1 : function() {
return true;
}
var _private2 : function() {
return true;
}
@bingeboy
bingeboy / gist:5606878
Created May 19, 2013 06:24
DOM2 Events
<html>
<head>
<title>Basic Dom2 Event Handler And Bubble Test</title>
</head>
<body>
<div id="container">
<ul id="listContainer">
<li id="item1">item1</li>
<li id="item2">item2</li>
</ul>
@bingeboy
bingeboy / clearFix
Created May 19, 2013 19:42
PPK Clear Fix w/floats
div.container {
border: 1px solid #000000;
overflow: auto;
width: 100%
}