Skip to content

Instantly share code, notes, and snippets.

View iCodeForBananas's full-sized avatar

Michael Calkins iCodeForBananas

  • AWS
  • Seattle, WA
View GitHub Profile
'use strict';
var gulp = require('gulp');
var open = require('open');
var wiredep = require('wiredep').stream;
var nodemon = require('nodemon');
var livereload = require('gulp-livereload');
var htmlmin = require('gulp-htmlmin');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
<a
class='btn social-facebook btn-large'
href='https://www.facebook.com/sharer.php?s=100&p[title]=<?php echo urlencode($name); ?>&p[url]={{ urlencode(url("{$account->local}/{$meet->local}")) }}&p[summary]={{ urlencode(strip_html_tags($meet->overview)) }}&p[images][0]={{ urlencode(Config::get('aws.s3') . '/' . $meet->image) }}'
target='_blank'>&nbsp;</a>
<a
class='btn social-twitter btn-large'
href='https://twitter.com/share?url={{ urlencode(url("{$account->local}/{$meet->local}")) }}&text={{ urlencode($meet->name) }}'
target='_blank'>&nbsp;</a>
$.post('/newsletter/subscribe', { email: $('input.subscribe-input').val() }, function(data) {
if (data.error) {
return console.log(data.error);
}
$('.successful-subscribe').show();
});
/**
* Control the express shippping errors alert.
*/
$only_autom_products_in_shopping_cart = true;
foreach ($products as $product)
{
// is not a shipping method and is not a manufacturer product
if (! in_array($product['products']['products_id'], [416, 318]) && $product['manufacturers_id'] == 0)
{
$only_autom_products_in_shopping_cart = false;
@iCodeForBananas
iCodeForBananas / gulpfile.js
Created April 3, 2015 19:57
Gulpfile for serpprogress.com
'use strict';
var gulp = require('gulp');
var open = require('open');
var watch = require('gulp-watch');
var plumber = require('gulp-plumber');
var nodemon = require('nodemon');
var livereload = require('gulp-livereload');
var htmlmin = require('gulp-htmlmin');
var concat = require('gulp-concat');
var tessel = require('tessel');
var servolib = require('servo-pca9685');
var servo = servolib.use(tessel.port['A']);
var servoNumber = 2; // Plug your servo or motor controller into port 1
// Reenable the console
process.stdin.resume();
console.log('Type in numbers between 0.0 and 1.0 to command the servo.');
console.log('Values between 0.05 and 0.15 are probably safe for most devices,');
console.log('but be careful and work your way out slowly.');
@iCodeForBananas
iCodeForBananas / base64.txt
Last active August 29, 2015 14:23
Image placeholder. It's a base64 version of a 1x1 image that you can stretch to whatever size you need without a third party source.
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFElEQVQIW2MMDQ39z8DAwMAIYwAAKgMD/9AXrvgAAAAASUVORK5CYII=
@iCodeForBananas
iCodeForBananas / app.js
Created July 7, 2015 21:20
vuejs and vue-router working together.
var Vue = require('vue');
var Router = require('vue-router');
Vue.use(Router);
var App = Vue.extend({
template: '<h1>App</h1>{{ test }}<a v-link="/dashboard">Dashboard</a><a v-link="/daily-summary">Daily Summary</a><a v-link="/chat">Chat</a><a v-link="/secure-notes">Secure Notes</a>' +
'<router-view></router-view>', // <-- outlet
data: function() {
return {
_.replace = function(collection, identity, replacement) {
var index = _.indexOf(collection, _.find(collection, identity));
collection.splice(index, 1, replacement);
return collection;
};
/*!
* vue-router v0.1.0
* (c) 2015 Evan You
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):"object"==typeof exports?exports.VueRouter=e():t.VueRouter=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){function r(t){if(!o)throw new Error("Please install the Router with Vue.use() before creating an instance.");t=t||{},this.app=null,this._children=[],this._recognizer=new a,this._guardRecognizer=new a,this._started=!1,this._currentRoute={path:"/"},this._hasPushState="undefined"!=typeof history&&history.pushState,this._notFoundHandler=t.notFound||null,this._beforeEachHook=t.beforeEach||null,this._afterEachHook=t.afterEach||null,this._hashbang=t.hashbang!==!1,this._history=!(!this._hasPushState||!t.hist