Skip to content

Instantly share code, notes, and snippets.

<?php
header('Content-type: text/css');
include('../PHamlP_3/sass/SassParser.php');
$sass = new SassParser(array(
'vendor_properties'=> array(
'appearance' => array('-moz-appearance', '-webkit-appearance'),
'border-radius' => array('-moz-border-radius','-webkit-border-radius'),
'box-shadow' => array('-moz-box-shadow', '-webkit-box-shadow'),
'box-sizing' => array('-moz-box-sizing', '-webkit-box-sizing'),
@ZeeAgency
ZeeAgency / SASS convertion cleaner
Created January 18, 2011 22:37
It just adds the missing indentation for end brackets...
<!doctype>
<pre>
<?php
$scss = file($myCssFilePath);
$tab = ' ';
foreach($scss as $line) {
$tabLevel = 0;
for($i = 0; $i<50; $i++) {
if(substr($line, $i, 1) == $tab) {
$tabLevel = $i;
@ZeeAgency
ZeeAgency / Who is listening ?
Created January 31, 2011 13:27
Little ugly jQuery snippet detecting which nodes are listening to click events
var listenedNodes = [];
$('*').each(function() {
if($(this).data('events') && $(this).data('events').click && $(this).data('events').click.length) {
listenedNodes.push(this);
}
});
@ZeeAgency
ZeeAgency / gist:948808
Created April 29, 2011 19:00
CSS Scrollbar detection Modernizr plugin
// Works only with Modernizr 1.8pre+
Modernizr.addTest('cssscrollbar', function() {
// Tested Element
var test = document.createElement('div'),
// Fake body
fake = false,
root = document.body || (function () {
@ZeeAgency
ZeeAgency / jquery.ajaxlog.js
Created May 23, 2011 13:00
jQuery AJAX Log
$.ajaxPrefilter(function(options, original, jqXHR) {
console.info('AJAX', options.type.toUpperCase(), options.url, options, jqXHR);
});
@ZeeAgency
ZeeAgency / LICENSE.txt
Created June 23, 2011 23:16 — forked from 140bytes/LICENSE.txt
dependency management
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@ZeeAgency
ZeeAgency / gist:1044377
Created June 24, 2011 07:23
HTML5 Volume Control Detection Modernizr Plugin
// Apple decided to not give control of <audio> & <video> volume...
Modernizr.addTest('volume', function() {
// Tested Element
var test = document.createElement('audio');
test.volume = 0.5;
return Modernizr.audio && test.volume === 0.5;
@ZeeAgency
ZeeAgency / mouette.js
Created September 27, 2011 14:48
Question Backbone pour Neiluj
var mouetteView = Backbone.View.extend({
el: '#mouette-container',
initialize: function() {
this.mouettes = new mouetteList(); // (collection de mouettes)
this.mouettes.bind('all', this.render, this);
this.mouettes.fetch();
this.template = _.template($('#mouette-template').html());
},
@ZeeAgency
ZeeAgency / inline_example.scss
Created November 2, 2011 14:56 — forked from chriseppstein/inline_example.scss
generate an inline sprite.
@include "icon/*.png";
#{$icon-sprite-base-class} {
background-image: inline-sprite($icon-sprites);
}
@ZeeAgency
ZeeAgency / modernizr.unicode.js
Created December 6, 2011 08:57
Modernizr Unicode character detection plugin
/**
* Unicode special character support
*
* Detection is made by testing missing glyph box rendering against star character
* If widths are the same, this "probably" means the browser didn't support the star character and rendered a glyph box instead
* Just need to ensure the font characters have different widths
*/
Modernizr.addTest('unicode', function() {