Skip to content

Instantly share code, notes, and snippets.

View mparke's full-sized avatar

Matthew Parke mparke

View GitHub Profile
@mparke
mparke / gulpfile.js
Created November 20, 2014 04:22
Example gulpfile.js
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var bump = require('gulp-bump');
var git = require('gulp-git');
var del = require('del');
var header = require('gulp-header');
var rename = require("gulp-rename");
var runSequence = require('run-sequence');
@mparke
mparke / karma.conf.js
Created November 20, 2014 04:28
Example karma.conf.js
// Karma configuration
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// frameworks to use
frameworks: ['jasmine'],
python3 get-pip.py
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting pip
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
@mparke
mparke / gist:6829520
Created October 4, 2013 17:24
inherits example
(function() {
function extend(obj, props) {
}
function inherits(Parent, Child) {
function Proxy() {
this.constructor = Child;
}
@mparke
mparke / gist:6369605
Created August 28, 2013 18:36
Chaining functions together for async work
function createLinkGetter(linkProcessFn) {
return function(url) {
asyncFetch(url, linkProcessFn);
};
}
function createLinkProcessor(fetchPageFn) {
return function(links) {
for(var i = 0; i < links.length; i++) {
fetchPageFn(links[i]);
@mparke
mparke / gist:6257618
Created August 17, 2013 16:07
Sonifizer.js Original
// //---------------------------------------------
// // ************** Sonifizer.js **************
// //---------------------------------------------
// // http://www.Sonifizer.com/Sonifizer.js
// //---------------------------------------------
// // Andrew Madden
// //---------------------------------------------
// var Sonifizer_Base_URL = "http://www.Sonifizer.com";
//---------------------------------------------
// ************** Sonifizer.js **************
//---------------------------------------------
// http://www.Sonifizer.com/Sonifizer.js
//---------------------------------------------
// Andrew Madden
//---------------------------------------------
var Sonifizer_Base_URL = "http://www.Sonifizer.com";
@mparke
mparke / base.js
Created August 2, 2013 19:17
Backbone base view with Handlebars template rendering and nested view support.
App.Views.Base = Backbone.View.extend({
templateName: null,
model: null,
render: function(options){
var data;
if(this.templateName !== null){
if(this.model !== null){
data = this.model.toJSON()
@mparke
mparke / gist:5855348
Last active December 18, 2015 22:38
Matrix find function intended for use with pixel positions
//searches the matrix for x and y pixel position using binary search
function find(x, y){
var rowData = binarySearch(mx, 0, mx.length - 1, 'y', this.ySize, y);
var colData = binarySearch(rowData.x, 0, rowData.x.length - 1, 'x', this.xSize, x);
return colData;
}
function binarySearch(arr, start, stop, bottomBoundKey, size, val){
var midpoint, data, midBottomBound, midTopBound;
@mparke
mparke / gist:5855304
Created June 25, 2013 01:50
Matrix shift and unshift prototype
function shift(){
var yLen = mx.length,
row;
if(yLen > 0){
row = mx[0];
if(row.length > 0){
return row.shift();
}else{