Skip to content

Instantly share code, notes, and snippets.

View yvesvanbroekhoven's full-sized avatar

Yves Van Broekhoven yvesvanbroekhoven

View GitHub Profile
@yvesvanbroekhoven
yvesvanbroekhoven / application_helper.rb
Created August 9, 2012 13:46
Frontend Lalala helpers
module ApplicationHelper
#
# Returns css class for <body>
#
def body_class
body_class = []
body_class << (params[:controller].gsub('_','-') rescue nil)
body_class << (params[:action].gsub('_','-') rescue nil)
body_class << @body_class if @body_class
@yvesvanbroekhoven
yvesvanbroekhoven / mediaquery.sublime-snippet
Created August 31, 2012 09:35
Sublime snippet CSS media query
<snippet>
<content><![CDATA[
@media (min-width: \$min_width_${1:size}) {
${2}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>@media</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
@yvesvanbroekhoven
yvesvanbroekhoven / sublime_text_2_dropbox.sh
Last active May 7, 2017 10:58
Sublime Text 2 Dropbox sync
rm -r ~/Library/Application\ Support/Sublime\ Text\ 2/Installed\ Packages
rm -r ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
rm -r ~/Library/Application\ Support/Sublime\ Text\ 2/Pristine\ Packages
ln -s ~/Dropbox/Application\ Support/Sublime\ Text\ 2/Installed\ Packages/ ~/Library/Application\ Support/Sublime\ Text\ 2/Installed\ Packages
ln -s ~/Dropbox/Application\ Support/Sublime\ Text\ 2/Packages/ ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
ln -s ~/Dropbox/Application\ Support/Sublime\ Text\ 2/Pristine\ Packages/ ~/Library/Application\ Support/Sublime\ Text\ 2/Pristine\ Packages
@yvesvanbroekhoven
yvesvanbroekhoven / convert.rb
Created November 5, 2012 14:19
Convert mp4 to m4v, ogv & gif
#
# Convert mp4 to m4v, ogv & gif
#
# Dependencies:
# * ffmpeg (brew install ffmpeg)
# * ffmpeg2theora (brew install ffmpeg2theora)
#
# Put this file in a folder containing mp4's you want to convert.
#
# In terminal run following command:
@yvesvanbroekhoven
yvesvanbroekhoven / httpd.conf
Created November 7, 2012 10:25
Apache dev config Mac OSX
#
# 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 / 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;
@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 / 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 / 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 / _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);
}