Skip to content

Instantly share code, notes, and snippets.

View roden0's full-sized avatar
🎯
Focusing

Rodrigo Encinas roden0

🎯
Focusing
  • Barcelona
View GitHub Profile
if ( elem.checked )
if ( $(elem).prop("checked") )
if ( $(elem).is(":checked") )
/*
- Atributos que se modifican con attr(): class, id, href, label, src, title...
- Propiedades que se modifican con prop(): autofocus, checked, async, multiple, readOnly...
*/
@roden0
roden0 / checkresize.js
Created June 5, 2013 11:47
Analytics check if user resizes or changes orientation. Based on David Goss' http://davidgoss.co.uk/2012/01/26/do-users-resize-their-browser-windows/
$(window).one({
resize: function() {
_gaq.push(['_trackEvent', 'Viewport', 'Resize']);
},
orientationchange: function() {
_gaq.push(['_trackEvent', 'Viewport', 'Orientation Change']);
}
});
$(window).resize(function() {
@value: #000;
.mixin {
color: @value;
}
@value: #333;
.parametric() {
color: @value;
@roden0
roden0 / app-ltr.less
Created May 30, 2013 10:07
Bidirectional styles with Less
@left: left;
@right: right;
@import "main.less";
@roden0
roden0 / markup.html
Last active December 17, 2015 20:39
Selector API
<div id="foo">
<p>first paragraph</p>
<p>second paragraph</p>
</div>
<div id="bar">
@roden0
roden0 / gauge.css
Created May 29, 2013 08:30
Wijmo + Anglar JS
body
{
font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
font-size: 14px;
background: #000;
}
h1
{
font-size: 2.4em;
body
{
font-family: "Segoe UI Light", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
font-size: 14px;
background: #000;
}
h1
{
font-size: 2.4em;
@roden0
roden0 / draganddrop.css
Created May 29, 2013 07:40
HTML5 drag & drop.
table {
border-collapse: collapse;
margin: 32px;
}
th, td {
border: 1px solid #CCC;
padding: 4px;
}
@roden0
roden0 / objecthasproperty.js
Created May 28, 2013 09:05
Javascript objects. Check if object has property.
var obj = {
a: undefined,
b: null,
c: false
};
// a, b, c all found
for ( var prop in obj ) {
document.writeln( "Object1: " + prop );
}
var LoggerFactory = {
getLogger: function() {
return window.console;
},
//log
};
/* Example Usage */
var logger = LoggerFactory.getLogger();
logger.log("something to log");