Skip to content

Instantly share code, notes, and snippets.

View yvesvanbroekhoven's full-sized avatar

Yves Van Broekhoven yvesvanbroekhoven

View GitHub Profile
@yvesvanbroekhoven
yvesvanbroekhoven / SassMeister-input-HTML.html
Created April 24, 2014 09:53
Generated by SassMeister.com.
<div class="wrapper">
<div class="a1"></div>
<div class="a2"></div>
<div class="a3"></div>
<div class="two-third"></div>
<div class="one-third"></div>
@yvesvanbroekhoven
yvesvanbroekhoven / has_flash.js
Created February 11, 2014 10:20
Javascript check if Flash installed & enabled
/**
* Check if Flash is installed & enabled
* http://stackoverflow.com/questions/998245/how-can-i-detect-if-flash-is-installed-and-if-not-display-a-hidden-div-that-inf
*
* @return {Boolean}
*/
var hasFlash = function() {
var has_flash = false;
try {
@yvesvanbroekhoven
yvesvanbroekhoven / module-a-ext.js
Created December 3, 2013 10:08
How can I use CommonJS modules to extend eachother or create inheritance? (This is pseudo code)
var ModuleA = require('module-a');
function ModuleAExt() {
ModuleA.prototype.change_name = function(name) {
this.name = name;
};
return ModuleA;
}
@yvesvanbroekhoven
yvesvanbroekhoven / __bind.js
Created October 24, 2013 12:39
JS context bind
var __bind = function(fn, me) {
return function() { return fn.apply(me, arguments); };
};
@yvesvanbroekhoven
yvesvanbroekhoven / release_version
Created October 22, 2013 07:38
Simple sofware version release incrementation script
#!/usr/bin/env bash
if ! [[ -a "VERSION" ]]; then
echo "VERSION file initialized"
touch "VERSION"
echo "0.0.0" > "VERSION"
fi
version=$(cat VERSION)
version_arr=(${version//./ })
@yvesvanbroekhoven
yvesvanbroekhoven / _keyframes.css.scss
Last active December 19, 2015 07:19
A list of SCSS mixins & functions I use a lot
//
// Shake horizontally
//
// Use:
// @include animation(shake-x 1s);
//
@include keyframes(shake-x) {
0%, 100% {
@include translateX(0);
}
@yvesvanbroekhoven
yvesvanbroekhoven / wp_is_mobile_usecase.php
Last active December 17, 2015 00:59
wp_is_mobile() usecase
<?php if ( wp_is_mobile() ) : ?>
<!-- HTML for mobile -->
<?php else : ?>
<!-- HTML for not mobile() -->
<?php endif; ?>
@yvesvanbroekhoven
yvesvanbroekhoven / httpd.conf
Created February 25, 2013 10:03
OSX Apache setup combined with POW
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@yvesvanbroekhoven
yvesvanbroekhoven / ruby-singleton-inheritance.rb
Created February 21, 2013 15:19
Ruby singleton & inheritance
class Parent
def self.name(name)
@name = name
puts @name
end
def whoami
puts "I'm the parent #{@name}"
end
@yvesvanbroekhoven
yvesvanbroekhoven / spiderman.scss
Last active December 11, 2015 20:49
Spiderman is a mixin to absolute position an element in his first relative parent, top to bottom, left to right.
//
// Spiderman is a mixin to absolute position an element
// in his first relative parent, top to bottom, left to right.
//
// @param $offset Offset from the edge
//
@mixin spiderman($offset: 0) {
bottom: $offset;
left: $offset;
position: absolute;