Skip to content

Instantly share code, notes, and snippets.

View richardh-vccp's full-sized avatar

Richard Homewood richardh-vccp

View GitHub Profile
WARNING: the code that follows will make you cry; a safety pig is provided below for your benefit.
_
_._ _..._ .-', _.._(`))
'-. ` ' /-._.-' ',/
) \ '.
/ _ _ | \
| a a / |
\ .-. ;
'-('' ).-' ,' ;
@richardh-vccp
richardh-vccp / backup-to-gitlab
Created April 20, 2015 09:01
GitHub to GitLab Backup
#!/bin/sh
token=ENTERYOURTOKEN
namespace_name=ENTERNAMESPACENAME
namespace_id=ENTERNAMESPACEID
repo=$1
git clone --mirror git@github.com:vccp/$repo.git &&
cd $repo.git &&
@richardh-vccp
richardh-vccp / index.less
Created September 2, 2014 16:50
IE8 PNG Alpha mixin
.ie8-alpha-fix() {
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)"; /* IE8 */
zoom: 1;
}
@richardh-vccp
richardh-vccp / index.js
Last active August 29, 2015 14:05
Add tracking tag before hash fragment
function add_tracking_tag(u, t) {
var url = u,
tag = t;
if (url.match('#')) {
url = url.replace('#', tag + '#');
} else {
url = url + tag;
}
@richardh-vccp
richardh-vccp / main.js
Created August 20, 2014 17:26
jQuery deferred animation
$.when(
$('.elem-one').animate({ left: 25, width: 200 }, 500, 'easeOutElastic')
).then(function() {
$('.elem-two').animate({ width: 150 }, 500, 'easeOutElastic')
return $('.elem-one').animate({ top: 108 }, 500, 'easeOutElastic')
});
@richardh-vccp
richardh-vccp / index.html
Created March 31, 2014 10:09
IE Conditional <html>
<!--[if HTML5]><![endif]-->
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
module.exports = {
DATA_ATTR: 'data-tracker',
init: function() {
var _this = this;
_this.bind();
},
bind: function() {
var _this = this;