Skip to content

Instantly share code, notes, and snippets.

View alastairjwright's full-sized avatar

Alastair Wright alastairjwright

View GitHub Profile
@alastairjwright
alastairjwright / domani_email_slice_N_dicer.php
Created March 11, 2014 18:33
Create html email from sliced psd images.
<?php
// 1. slice psd into rows
// 2. slice up rows into columns
// 3. export slices, if over 100 images, add a 0 to 2 digit numbers,
// so that php loops through in order.
// (e.g. image_53.jpg needs to be image_053.jpg)
// there's an app called NameChanger which will save you time
// http://www.mrrsoftware.com/MRRSoftware/NameChanger.html
// 4. set page width and other variables below
// 5. run build.php and POW! there's your html!
@alastairjwright
alastairjwright / stoke.less
Created January 23, 2014 17:12
CSS Stroke Mixin
.stroke(@base: base, @color: color, @shadow-color: shadow-color){
text-shadow:
(@base * -1) (@base * -1) 0 @color,
@base (@base * -1) 0 @color,
(@base * -1) @base 0 @color,
@base @base 0 @color,
((@base + 1) * -1) ((@base + 1) * -1) 0 @color,
(@base + 1) ((@base + 1) * -1) 0 @color,
((@base + 1) * -1) (@base + 1) 0 @color,
(@base + 1) (@base + 1) 0 @color,
@alastairjwright
alastairjwright / .bash_profile
Created January 10, 2014 20:46
My Bash Profile: - Cool colors - cdfinder command selects where you are in the finder - filestolower command renames all files to lower case - other useful shit also
#--- list all hidden files in the current folder
alias lh='ls -a | egrep "^\."'
#
# -------------- SVN
#
alias svnremovemissing='svn status | grep '^\!' | cut -c8- | while read f; do svn rm "$f"; done'
alias svna="svn add . --force"
@alastairjwright
alastairjwright / noconsolelogs.js
Last active January 2, 2016 10:09
Disable console logs if they don't exist.
window.log = function f(){ log.history = log.history || []; log.history.push(arguments); if(this.console) { var args = arguments, newarr; args.callee = args.callee.caller; newarr = [].slice.call(args); if (typeof console.log === 'object') log.apply.call(console.log, console, newarr); else console.log.apply(console, newarr);}};
(function(a){function b(){}for(var c="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),d;!!(d=c.pop());){a[d]=a[d]||b;}})
(function(){try{console.log();return window.console;}catch(a){return (window.console={});}}());