Skip to content

Instantly share code, notes, and snippets.

View andi1984's full-sized avatar
🏠
Working from home

Andreas Sander andi1984

🏠
Working from home
View GitHub Profile
require 'susy'
class CssSplitter
def self.split(infile, outdir = File.dirname(infile), max_selectors = 4095)
raise "infile could not be found" unless File.exists? infile
rules = IO.readlines(infile, "}")
return if rules.first.nil?
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
@andi1984
andi1984 / symfony_debug
Last active August 29, 2015 14:08
Access logger inside a controller.
<?php
$logger = $this->get('logger');
$logger->info('Hello World');
@andi1984
andi1984 / styles.css
Last active August 29, 2015 14:08 — forked from pburtchaell/styles.css
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
[alias]
ci = commit
lc = log ORIG_HEAD.. --stat --no-merges
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
llog = log --date=local
changes = diff --name-status -r
diffstat = diff --stat -r
new = !sh -c 'git log $1@{1}..$1@{0} "$@"'
@andi1984
andi1984 / vine.php
Last active August 29, 2015 14:17 — forked from marczobec/vine.php
<?php
kirbytext::$tags['vine'] = array(
'attr' => array(
'size'
),
'html' => function($tag) {
$vineURL = $tag->attr('vine');
$size = $tag->attr('size', '300');
@andi1984
andi1984 / grunt-modules.txt
Last active September 2, 2015 21:06
Grunt Must-Havs
npm install --save-dev load-grunt-tasks
npm install grunt-bowercopy --save-dev
@andi1984
andi1984 / what-forces-layout.md
Created October 5, 2015 21:10 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@andi1984
andi1984 / gist:3860897
Created October 9, 2012 19:28
javascript: Detect IE in JQuery
if($.browser.ie)
@andi1984
andi1984 / gameengines.md
Created October 10, 2012 06:37 — forked from bebraw/gameengines.md
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n