Skip to content

Instantly share code, notes, and snippets.

View Eworm's full-sized avatar
💭
Happy

Wout Mager Eworm

💭
Happy
View GitHub Profile

Keybase proof

I hereby claim:

  • I am eworm on github.
  • I am woutmager (https://keybase.io/woutmager) on keybase.
  • I have a public key ASD-y7cR2Tye4dMliXHdGVHDkKqj0Cv-yoAMGvPf1VoweQo

To claim this, I am signing this object:

<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
$data = json_decode($_POST['payload']);
if ($data->ref == 'refs/heads/master') {
shell_exec( 'cd /home/YOURNAME/webapps/WEBAPPNAME && git pull' );
}
}
?>
@Eworm
Eworm / gulpfile.js
Created June 1, 2014 07:48
Gulpfile with SCSS lint
var gulp = require('gulp');
// Get packages from package.json
var plugins = require("gulp-load-plugins")();
// Livereload stuff
lr = require('tiny-lr'),
server = lr();
@Eworm
Eworm / .scss-lint.yml
Last active August 29, 2015 14:01
SCSS lint preferences
linters:
Indentation:
enabled: true
width: 4
EmptyRule:
enabled: false
PropertySortOrder:
@Eworm
Eworm / gist:11398566
Created April 29, 2014 12:19
A simple wepb background function to use in combination with the modernizr test.
/* A webp sass include
=================================================================*/
@mixin webp-bg($image) {
/* This will assume you're using the webp modernizr test */
/* There's no default image. Not very pretty, but otherwise the browser will download both images */
.no-webp & {
/* We're assuming there's a jpg */
background-image: url($image + '.jpg');
var gulp = require('gulp');
// Get packages from package.json
var tasks = require("gulp-load-tasks")();
// Livereload stuff
lr = require('tiny-lr'),
server = lr();
@Eworm
Eworm / gist:5866977
Created June 26, 2013 12:22
Scroll to function because zepto doesn't have scrolltop animation
// Scroll function cause zepto doesn't have scrolltop animation
function scrollNew(scrollTo, time) {
var scrollFrom = parseInt(document.body.scrollTop),
i = 0,
runEvery = 5; // run every 5ms
scrollTo = parseInt(scrollTo);
time /= runEvery;
var interval = setInterval(function () {
@Eworm
Eworm / Svg-or-not mixin for SASS
Last active December 17, 2015 21:59
A SASS mixin to use an svg sprite for retina screens or a regular (.png) sprite. Must be used together with the svg check from modernnizr (or some other check) to set an svg class on the html. Usage: @include svg-or-not('img/sprite'); You can choose your own directory and spritename, and you don't have to add an extension. The mixin will either …
@mixin svg-or-not($image) {
background-repeat: no-repeat;
background-image: url($image + '.png');
.svg & {
/* On svg capable browsers, use an svg */
background-image: url($image + '.svg');
}
}