Skip to content

Instantly share code, notes, and snippets.

View jcblw's full-sized avatar
💤
Don't wake me, my computer is sleeping in.

Jacob Lowe jcblw

💤
Don't wake me, my computer is sleeping in.
View GitHub Profile
@jcblw
jcblw / killZoomy.js
Created November 15, 2011 01:51
asset for zoomy plugin for jquery
(function($){
$.fn.killZoomy = function(){
$(this)
//Unbinding any events attached
//be carefull not just zoomy functions
.removeClass('parent-zoom')
.unbind('click mousemove mouseover mouseleave')
//Removing inline style added inline from Zoomy
@jcblw
jcblw / gist:2646339
Created May 9, 2012 16:33
Tracking #hash changes
// Probably Need
// It seems to be depedent off this plugin too
// https://github.com/cowboy/jquery-hashchange
// ============================================
(function($){
$(window).hashchange(function(){
//Check you console for event
console.log('Changed to ' + window.location.hash);
@jcblw
jcblw / tracev.js
Created June 1, 2012 04:12
tacking events on click
/* Tracking events in Google Analytics
* ==============================================
* with this code all you need to do is add the class 'download' to the download button
* Then add the a 'contact' to the contact button
* In you Analytics go to Content > Events > Overview The events will be displayed there
*/
$(function(){
$('.download').bind('click', function(){
@jcblw
jcblw / gist:2920914
Created June 13, 2012 00:01
simple email php script that return json for ajax mail scripting
<?php
function process(){
$displayForm = true;
$success = false;
$error = array();
// insert a valid email from the domain your sending
$headers = "From: domain.com <email@domain.com>\r\n";
// html emails because were bada55
$headers .= "MIME-Version: 1.0\r\n";
@jcblw
jcblw / gist:2920965
Created June 13, 2012 00:18
send form data via ajax to php script
(function(){
/* Script that compiles values of form
* the sends them via ajax to php script
* php script will send back json after validation process
* use the console logs for debugging
*/
// you might need a better selector -> select your form
var form = $('form'),
// compile all values
@jcblw
jcblw / gist:3717552
Created September 13, 2012 20:50
Angular JS routeParams
/* Services */
//app
angular
.module('support', ['supportService'])
.config(['$routeProvider', function($routeProvider){
$routeProvider
.when('/p/:start/', {templateUrl: '/partials/warrantyList.html', controller: SupportListController})
.when('/v/:field/:id/', {templateUrl: '/partials/warrantyDetails.html', controller: SupportDetailController})
.otherwise({redirectTo: '/p/1'});
@jcblw
jcblw / Sandboxing.js
Last active December 10, 2015 21:58
Sandboxing pattern & some demo code
(function(_export) {
var Sandbox = function(modules, callback) {
if (!(this instanceof Sandbox)) {
return new Sandbox(modules, callback);
}
// modules is an array in this instance:
for (var i = 0, len = modules.length; i < len; i++) {
this.Modules[modules[i]](this);
}
callback(this);
@jcblw
jcblw / area.js
Created February 3, 2013 03:12
Get the area of a polygon
var points = [
[33.950649172363335,-117.40098863840103],
[33.95048007651844,-117.40097254514694],
[33.95035992926655,-117.40098059177399],
[33.950355479365065,-117.4010556936264],
[33.95048675136076,-117.40105032920837],
[33.95066363449239,-117.40104496479034]];
var area = function(points){
var length = points.length;
var arr = [];
@jcblw
jcblw / index.html
Created March 17, 2013 01:57
A CodePen by Jacob Lowe.
<label>
<input type="checkbox" class="switch"/>
<div class="switch"></div>
</label>
@jcblw
jcblw / index.html
Created March 17, 2013 07:07
Chrome Tabs
<div class=tab-container>
<ul class="tabs clearfix" >
<li>
<a href=# >Users</a>
</li>
<li class=active >
<a href=# >Pending Lots</a>
</li>
<li>
<a href=# >Nearby Lots</a>