Skip to content

Instantly share code, notes, and snippets.

Robert Wildling rowild

  • Vienna
Block or report user

Report or block rowild

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cms
cms / getStyle.js
Created Apr 17, 2010
Get computed styles
View getStyle.js
function getStyle(el, styleProp) {
var value, defaultView = el.ownerDocument.defaultView;
// W3C standard way:
if (defaultView && defaultView.getComputedStyle) {
// sanitize property name to css notation (hypen separated words eg. font-Size)
styleProp = styleProp.replace(/([A-Z])/g, "-$1").toLowerCase();
return defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
} else if (el.currentStyle) { // IE
// sanitize property name to camelCase
styleProp = styleProp.replace(/\-(\w)/g, function(str, letter) {
@fat
fat / gist:956180
Created May 4, 2011
better contains
View gist:956180
var ALEX = ['foo', 'bar'];
//n00bs write:
if (ALEX.indexOf('foo') > -1) {
//ALEX contains foo
}
//pros write:
if (~ALEX.indexOf('foo')) {
//ALEX contains foo
@cedmax
cedmax / LICENSE.txt
Last active Sep 25, 2015 — forked from 140bytes/LICENSE.txt
pub/sub custom events
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 cedmax <http://github.com/cedmax>
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
@its-florida
its-florida / jquery.spin.js
Created Oct 16, 2011
jQuery Plugin for Spin.js
View jquery.spin.js
/*
You can now create a spinner using any of the variants below:
$("#el").spin(); // Produces default Spinner using the text color of #el.
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el.
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color).
$("#el").spin({ ... }); // Produces a Spinner using your custom settings.
$("#el").spin(false); // Kills the spinner.
@necolas
necolas / README.md
Last active Nov 25, 2019
Experimenting with component-based HTML/CSS naming and patterns
View README.md

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name
@oalders
oalders / graphicsmagick.rb
Created Nov 10, 2011
install Graphics::Magick via homebrew
View graphicsmagick.rb
require 'formula'
def ghostscript_fonts?
File.directory? "#{HOMEBREW_PREFIX}/share/ghostscript/fonts"
end
def ghostscript_srsly?
ARGV.include? '--with-ghostscript'
end
@mklabs
mklabs / bootstrap-plugins.txt
Created Dec 2, 2011
h5bp + twitter bootstrap integration
View bootstrap-plugins.txt
bootstrap-tooltip.js
bootstrap-popover.js
bootstrap-alert.js
bootstrap-button.js
bootstrap-carousel.js
bootstrap-collapse.js
bootstrap-dropdown.js
bootstrap-modal.js
bootstrap-scrollspy.js
bootstrap-tab.js
@benjamincharity
benjamincharity / Local Fallback for jQuery and Modernizr
Created Jan 6, 2012
Include jQuery and Modernizr from a CDN and add local fallbacks in case the CDN fails. Versions written in HTML and HAML.
View Local Fallback for jQuery and Modernizr
HTML
=====
<script type='text/javascript'>
window.jQuery || document.write('<script src="js/jquery-1.7.1.js">\x3C/script>')
</script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/modernizr/2.0.6/modernizr.min.js' type='text/javascript'></script>
<script type='text/javascript'>
window.Modernizr || document.write('<script src="js/modernizr-2.0.6.js">\x3C/script>')
</script>
View example.js
// Example 1
mediator.name = 'Doug';
mediator.subscribe('nameChange', function(arg){
console.log(this.name);
this.name = arg;
console.log(this.name);
});
mediator.publish('nameChange', 'Jorn');
@berzniz
berzniz / gist:2045615
Created Mar 15, 2012
Adding a global notification system to backbone.js
View gist:2045615
Backbone.Notifications = {};
_.extend(Backbone.Notifications, Backbone.Events);
You can’t perform that action at this time.