Skip to content

Instantly share code, notes, and snippets.

choco install git.install
choco install nodejs.install
choco install notepadplusplus.install
choco install GoogleChrome
choco install flashplayerplugin
choco install adobereader
choco install ffmpeg
choco install vlc
choco install nodejs.install
choco install filezilla
npm install -g gulp
npm install -g jshint
npm install -g phantomjs
npm install -g browserify
npm install -g http-server
npm install -g bower
npm install -g ngrok
npm install -g nodemon
npm install -g node-inspector
npm install -g webpack
@DroopyTersen
DroopyTersen / OrientationPublisher.js
Last active August 29, 2015 14:15
Compass in the Browser
//http://mobiforge.com/design-development/html5-mobile-web-device-orientation-events
(function(window, $) {
window.OrientationPublisher = {
active: false
};
//Setup listener
OrientationPublisher.init = function() {
if (window.DeviceOrientationEvent && !OrientationPublisher.active) {
window.addEventListener("deviceorientation", OrientationPublisher.orientationChange, false);
<!DOCTYPE html>
<!-- HTML5 Hello world by kirupa - http://www.kirupa.com/html5/getting_your_feet_wet_html5_pg1.htm -->
<html lang="en-us">
<head>
<meta charset="utf-8">
<title>Near Me</title>
<style type="text/css">
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
@DroopyTersen
DroopyTersen / 0_jquery.spcollapsable.js
Last active August 29, 2015 14:18
SharePoint 2010 jQuery Plugin to make web parts collapsable
(function($){
var options = {
collapse: true,
expandHtml: "&#x25b6;",
collapseHtml: "&#x25bc;"
};
var makeCollapsable = function($wpElement, optionOverrides) {
$.extend(options, optionOverrides);
@DroopyTersen
DroopyTersen / 0_spMenuSpider.js
Last active August 29, 2015 14:18
Parses SP2010 top menu markup and returns a simplified menu object that outputs clean html
var spMenuSpider = (function($) {
var menu = [];
var MenuLink = function (name, url) {
this.name = name || "",
this.url = url || "#",
this.children = [];
};
MenuLink.prototype.toHtml = function() {
@DroopyTersen
DroopyTersen / droopy.datepicker.js
Created May 19, 2015 19:53
Automatically adds slashes
(function ($, window) {
var defaults = {
//not sure if we'll have defaults
};
var DroopyDatepicker = function (el, options) {
this.$element = $(el);
this.options = $.extend({}, defaults, options);
this._defaults = defaults;
this.init();
};
@DroopyTersen
DroopyTersen / Cache.js
Created September 19, 2016 19:10
Supports localStorage or sessionStorage. Supports optional expiration. Supports regex key cache clearing
var storage = localStorage;
var cache = {};
cache.setStorageType = function(localOrSessionStorage) {
storage = localOrSessionStorage
}
var _isExpired = function(cacheValue) {
return (cacheValue.expiration) && ((new Date()).getTime() > cacheValue.expiration);
};
// THIS IS A NODEJS WEB SERVER RUNNING ON PI
var bodyParser = require("body-parser");
var express = require("express");
var createGuid = require('node-uuid').v4;
var app = express();
app.use(bodyParser.json()); //to handle POST body
// THESE DONT EXIST YET
var azureCam = require("azure-cam"); // bschlintz npm published module
var middlewarify = function(pre, post) {
post = post || function(next) { next() }
var doIt = function(next, params) {
return pre(next, params);
}
var func = function(params) {
func.use(post)
return new Promise((resolve, reject) => {