Skip to content

Instantly share code, notes, and snippets.

View svnlto's full-sized avatar
🦙

Sven Lito svnlto

🦙
View GitHub Profile
@jackfuchs
jackfuchs / jquery.support.cssproperty.js
Last active July 19, 2024 17:38
Extends the jQuery.support object to CSS Properties
/**
* jQuery.support.cssProperty
* To verify that a CSS property is supported
* (or any of its browser-specific implementations)
*
* @param p css property name
* @param rp optional, if set to true, the css property name will be returned
* instead of a boolean support indicator
* @return {mixed}
*
var types = {
'.3gp' : 'video/3gpp',
'.a' : 'application/octet-stream',
'.ai' : 'application/postscript',
'.aif' : 'audio/x-aiff',
'.aiff' : 'audio/x-aiff',
'.asc' : 'application/pgp-signature',
'.asf' : 'video/x-ms-asf',
'.asm' : 'text/x-asm',
'.asx' : 'video/x-ms-asf',

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@jacob414
jacob414 / backbone-tutorial.js
Created November 18, 2010 12:54
Minimal example of data handling in Backbone.js
/* Scaled-down Backbone.js demonstration
* By Jacob Oscarson (http://twitter.com/jacob414), 2010
* MIT Licenced, see http://www.opensource.org/licenses/mit-license.php */
$(function() {
window.ulog = function(msg) { $('#log').append($('<div>'+msg+'</div>')); }
// Faking a little bit of Backbone.sync functionallity
Backbone.sync = function(method, model, succeeded) {
ulog('<strong>'+method + ":</strong> " + model.get('label'));
if(typeof model.cid != 'undefined') {
@kolber
kolber / sequential-gallery.html
Created January 28, 2011 03:35
A dead simple, sequential image gallery (good for pulling together quick in-browser design presentations)
@dmachi
dmachi / LocalStorage.js
Created March 22, 2011 05:26
LocalStorage wrapper providing dojo.store interface
define("dojo/store/LocalStorage", ["dojo", "dojo/store/util/QueryResults", "dojo/store/util/SimpleQueryEngine"], function(dojo) {
dojo.declare("dojo.store.LocalStorage", null, {
constructor: function(/*dojo.store.LocalStorage*/ options){
// summary:
// localStorage based object store.
// options:
// This provides any configuration information that will be mixed into the store.
// This should generally include the data property to provide the starting set of data.
if (!dojo.global.localStorage){
@tommeier
tommeier / xvfb_daemon.sh
Created April 27, 2011 10:44
Xvfb startup init script for headless selenium with multiple displays for Jenkins or Teamcity CI server
#!/bin/bash
# /etc/init.d/xvfb_daemon
# Xvfb startup script.
# Tom Meier <tom@venombytes.com>
#
### BEGIN INIT INFO
# Provides: xvfb
# Short-Description: Start/stop/restart daemon
# Description: Controls the Xvfb daemon which starts/stops the X Virtual Framebuffer server
# Example Use:
@jamesarosen
jamesarosen / 04_jshint.rake
Created May 2, 2011 23:41
Javascript Loves CI: Jenkins + Jasmine + PhantomJS + JSHint
namespace :jshint do
task :require do
sh "which jshint" do |ok, res|
fail 'Cannot find jshint on $PATH' unless ok
end
end
task :check => 'jshint:require' do
project_root = File.expand_path('../../', File.dirname(__FILE__))
config_file = File.join(project_root, 'config', 'jshint.json')
@mathieul
mathieul / gist:966776
Created May 11, 2011 16:12
Require files using RequireJS before running Jasmine specs
/*
* jasmine.requirejs() returns a function that will load the file(s) required
* and will wait until it's done before proceeding with running specs.
* The function returned is intended to be passed to beforeEach() so the file(s)
* is(are) loaded before running each spec.
*
* Syntax:
*
* jasmine.requirejs(options, files)
* or
@cloudhead
cloudhead / gist:967157
Created May 11, 2011 19:38
LESS v1.1.0 - What's new

LESS v1.1.0 - What's new

@arguments special variable:

  .box-shadow () { -webkit-box-shadow: @arguments }

string interpolation:

content: "hello @{var}"; // replaced with value of @var