Skip to content

Instantly share code, notes, and snippets.

View castus's full-sized avatar

Krzysztof Romanowski castus

View GitHub Profile
@castus
castus / google-weather-api-conditions.xml
Created June 28, 2012 08:55 — forked from bzerangue/google-weather-api-conditions.xml
Google Weather API Conditions List
<?xml version="1.0" encoding="UTF-8"?>
<!--Google Weather API Conditions. Compiled by Dennis Delimarsky, http://dennisdel.com/content/conditions.xml-->
<!--Tweaked by Brian Zerangue, February 1, 2011-->
<conditions>
<type handle="partly-sunny">Partly Sunny</type>
<type handle="scattered-thunderstorms">Scattered Thunderstorms</type>
<type handle="showers">Showers</type>
<type handle="scattered-showers">Scattered Showers</type>
<type handle="rain-and-snow">Rain and Snow</type>
<type handle="overcast">Overcast</type>
@castus
castus / osx_lion_rail_setup.md
Created July 16, 2012 12:47 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@castus
castus / helpers.rb
Created November 9, 2012 10:00
[Ruby,Sass] Workaround for sass-rails gem error, when trying to get :resolver from nil
def resolver
puts options[:custom].inspect
# options[:custom][:resolver]
Resolver.new(CompassRails.context)
end
@castus
castus / gist:5180851
Created March 17, 2013 09:53
[css] Disable User Selection
<style>
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
}
</style>
@castus
castus / gist:5301987
Created April 3, 2013 15:03
[JS] Retrieve the color property of the .element:before
var color = window.getComputedStyle(
document.querySelector('.element'), ':before'
).getPropertyValue('color');
@castus
castus / spine.rebind.js
Created April 4, 2013 12:22
[JS, SpineJS] Add rebind method for Spine's controller
Spine.Controller.prototype.rebind = function(element) {
var previous, _ref;
_ref = [this.el, $(element.el || element)], previous = _ref[0], this.el = _ref[1];
this.delegateEvents(this.events);
this.refreshElements();
return this.el;
};
@castus
castus / prevent-window-scroll.js
Created April 14, 2013 10:28
[JS] Prevent window's and body scroll without overfow:hidden
$(window).scroll(function(event) {
if (cSubpage) {
event.preventDefault();
$('body,html').scrollTop(cScrolltop);
return;
}
});
@castus
castus / better-onchange.js
Created May 16, 2013 10:11
[js] A better onChange event
var input = jQuery("textarea");
function logger() { console.log(Array.prototype.slice.call(arguments)); }
function okay(e) {
logger(e.keyCode, input.val());
}
function better(e) {
setTimeout(function() {
logger(e.keyCode, input.val());
}, 0);
@castus
castus / ios-smart-banners.html
Created June 17, 2013 10:02
[html] iOS smart banners
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">
@castus
castus / jquery.sugar.js
Created September 10, 2013 13:14
[JS] jQuery's replacement for native methods
/**
*
* Find more about the lame micro-framework at
* http://cubiq.org/
*
* Copyright (c) 2010 Matteo Spinelli, http://cubiq.org/
* Released under MIT license
* http://cubiq.org/dropbox/mit-license.txt
*
*/