Skip to content

Instantly share code, notes, and snippets.

View marklearst's full-sized avatar
:accessibility:
👾 Pushing pixels with purpose. 🛠️ Tools for humans.

Mark Learst marklearst

:accessibility:
👾 Pushing pixels with purpose. 🛠️ Tools for humans.
View GitHub Profile
@marklearst
marklearst / gist:1387525
Created November 23, 2011 00:18
checkbox drag example
var trackXY = {};
$("#listImages li img").each(function(index) {
$(this).attr("id", 'image'+(index+1));
$(this).mousedown(function(e) {
trackXY.y = e.pageY;
trackXY.x = e.pageX;
//START YOUR DRAG STUFF
});
var carouselController = (function() {
// Didn't make a single var due to clarity;
var currentSection = "shoppers";
var currentDevice = "desktop"
var imageAssetsDesktop = {
shoppers:["images/billboards/shoppers/vehicle billboard/desktop/fv_rad_billboard_vehicle.jpg", "images/billboards/shoppers/incentives/desktop/fv_rad_billboard_incentives.jpg", "images/billboards/shoppers/mttoty/desktop/fv_rad_billboard_mttoty.jpg", "images/billboards/shoppers/mustang/desktop/fv_rad_billboard_mustang.jpg"],
owners:["images/billboards/owners/owners home/desktop/fv_rad_billboard_owners.jpg","images/billboards/owners/payment options/desktop/fv_rad_billboard_paymentoptions.jpg","images/billboards/owners/owners home/desktop/fv_rad_billboard_owners.jpg","images/billboards/owners/payment options/desktop/fv_rad_billboard_paymentoptions.jpg"],
community:["images/billboards/community/corporate/desktop/fv_rad_billboard_corporate.jpg","images/billboards/community/ford
@marklearst
marklearst / index.php
Created April 25, 2012 04:29
Testing Sublime Text 2 Gist
<link rel = "stylesheet" href="css/reset.css" type="text/css" />
<link rel = "stylesheet" href="css/text.css" type="text/css" />
<link rel = "stylesheet" href="css/style.css" type="text/css" />
@marklearst
marklearst / gist:2562334
Created April 30, 2012 20:14
Next / Prev Idea
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div class="wrapper">
<div class="gallery">
@marklearst
marklearst / gist:2661492
Created May 11, 2012 18:21
simple swipe example
$(document).on('touchstart', "document", function(event) {
var orig = event.originalEvent,
trackTouchX = orig.changedTouches[0].pageX,
trackTouchY = orig.changedTouches[0].pageY,
trackIt = orig.changedTouches[0].pageX,
thresholdX = 20,
thresholdY = 5
});
$(document).on('touchend', "document", function(event) {
var orig = event.originalEvent;
@marklearst
marklearst / snazzy_gradient.css
Last active December 12, 2015 05:48
For Bitchard's Nav
#global-nav-flyout .vehicles{
float:left;
display: inline-block;
overflow:hidden;
height:260px;
flex: 1;
position: relative;
}
/* You CAN change the .vehicles:before selector to a different one that
@marklearst
marklearst / micro_model_collection.js
Created March 30, 2015 13:47
Basic micro Model/Collection example
// Simple Model/Collection
// Person model
var Person = function(dataset) {
this.firstName = dataset.firstName;
this.lastName = dataset.lastName;
this.age = dataset.age;
this.getFullName= function() {
return firstName + " " + lastName;
};
this.getAge = function() {
var foo = !function() {
return {
bar: function() { return "Hello World"; },
foobar: function() { return 5; }
};
}();
console.log(foo);
var fooAlt = (function() {
return {
@marklearst
marklearst / .zshrc
Created December 31, 2016 18:40
My .zshrc configuration file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/Mark/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="materialshell-oceanic"
@marklearst
marklearst / .bash_profile
Created December 31, 2016 18:44
My .bash_profile configuration file.
export PATH=/usr/local/bin:$PATH
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
if [ -f /usr/local/etc/bash_completion ]; then
. /usr/local/etc/bash_completion
fi
parse_git_dirty() {