Skip to content

Instantly share code, notes, and snippets.

View labs-scnm's full-sized avatar

Sebastian Müller labs-scnm

View GitHub Profile
@labs-scnm
labs-scnm / gist:2916869
Created June 12, 2012 10:53 — forked from sergejmueller/gist:2912115
Google Analytics Tracking-Code zum Protokollieren von simplen A/B-Tests
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-Y']);
_gaq.push(['_trackPageview']);
_gaq.push(
function() {
var tracker = _gat._getTrackerByName(),
group = tracker._getVisitorCustomVar(1),
random = Math.random();
@labs-scnm
labs-scnm / dabblet.css
Created June 13, 2013 11:33 — forked from tomax/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
module.exports = {
'A lot of screenshots': function (test) {
var resolutions = [{width: 1280, height: 1024}, {width: 1024, height: 768}, {width: 800, height: 600}];
var pages = ['http://facebook.com', 'http://twitter.com', 'http://dalekjs.com'];
resolutions.forEach(function (res) {
pages.forEach(function (page) {
test.open(page)
.resize(res)
(function(){
var $ = jQuery;
var TRANSFORM_TYPES = ['PUT', 'POST', 'DELETE'];
$.activeTransforms = 0;
$(document).ajaxSend(function(e, xhr, settings) {
if (TRANSFORM_TYPES.indexOf.call(settings.type) < 0) return;
return $.activeTransforms += 1;
@labs-scnm
labs-scnm / .htaccess
Created November 29, 2013 15:29 — forked from michaelhagedon/.htaccess
A modified Symfony2 .htaccess file that makes it possible to set the front controller from the Apache virtual host (kind of like Rails).
<IfModule mod_rewrite.c>
RewriteEngine On
### Call the correct front controller. This is dependent on an environment variable being set
### in the virtual host configuration. SetEnv seems not to work, so here's an example with SetEnvIfNoCase:
### <Directory /path/to/application/web>
### SetEnvIfNoCase REQUEST_URI .* SYMFONY_ENV=dev
### </Directory>
### This will force the following rules to call the dev front controller.
@labs-scnm
labs-scnm / 0_reuse_code.js
Created December 12, 2013 09:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console