A web component that create a CSS-only floating label for input
tags
_.mixin({ | |
// - Checks if a string is a full URL | |
// Source: https://gist.github.com/tracend/a522e5a169aad662fa80 | |
isURL: function ( url ) { | |
// prerequisite | |
if( typeof url != "string" ) return false; | |
// | |
return ( url.substr(0, 4) == "http" || url.substr(0, 2) == "//" ); | |
} | |
}); |
_.mixin({ | |
// - Returns the directory of a url or full path | |
// Source: https://gist.github.com/tracend/31436d82befafab96d15 | |
getDir: function ( url ) { | |
// prerequisite | |
if( typeof url != "string" ) return ""; | |
// | |
var location = url.match(/^.*[\\\/]/); | |
// return if there are any matches... | |
return ( location !== null ) ? location[0] : ""; |
Animates text like a terminal output.
the main purpose of this gist is to create an effect without any moving parts (variables)
Loosely based on the typewriter effect by Lea Verou and this StackOverflow discussion
Our lives are intertwined with the Internet. Our media, our communication, our favorite services, all live online. The "cloud" has evolved from a novelty to an intimate part of our everyday reality. People have already started wondering if our dependence to being online is healthy. But now that we're here, how can we ever go back to living without it?
Let me start with a short disclaimer. This is not going to be an essay infused with nostalgia of the "good ol' days" and cynicism towards the Internet. I love the concept and potential of being online. Everything I produce is published online. My main concern is the way my work is planned and executed, so it is relevant in the upcoming years. Hope you feel the same...
Some think of it as a network of servers, some as a "series of tubes" but truth of the matter is that the Internet has been re
// Handlebars.size: get the size of an object | |
// Source: https://gist.github.com/tracend/71e3cb5069edaa0bceae | |
Handlebars.registerHelper('size', function(obj) { | |
// prerequisite | |
if( typeof obj != "object" ) return; | |
var size = 0, key; | |
for (key in obj) { | |
if (obj.hasOwnProperty(key)) size++; | |
} | |
return size; |
// Handlebars.copyright: render copyright text | |
// Source: https://gist.github.com/tracend/f861b81d087c68b99412 | |
Handlebars.registerHelper('copyright', function(prefix, suffix) { | |
var text = "Copyright © "; | |
// prefix | |
if(typeof prefix == "string") text += prefix; | |
// add year | |
var today = new Date(); | |
var year = today.getFullYear(); | |
text += year; |
// # Build script using Node.js | |
// | |
// Single script build,used as a lightweight alternative | |
// when a build platform (grunt/gulp wtc.) feels like overkill | |
// | |
// - Dependencies: NPM/Node.js | |
// - Conventions: | |
// * code is in a lib/ folder with a main.js as the main context (closure) | |
// * a package.json on the root contains all the info about the lib: name, description, author, license | |
// * compiled files are saved in a build folder |
This is an anniversary piece to commemorate two years since the conception of Construct. It is also a call to action for everyone interested in participating in the next wave of realtime 3D
WebGL is officially supported in all platforms that matter and there's been a lot of movement towards creating concept 3D applications in the browser. These past years we all experimented, created libraries, gave talks, wrote articles. But all this is still not enough.
In the 90s you would often hear on MTV the phrase "keep it real". Basically it means "be true to who you are"; it was the normal attitude when alternative rock was at the forefront of popular music. But what does all this have to do with developing?
Being "real" is on the opposing side of the trend that followed and furthermore what developers are still facing today. I'm talking about political correctness. In the post-millennium era we've grown to think that being politically correct is better, with the consensus that being "real" is just ugly.
There's virtually no argument today when you are asked to do what you're "supposed to", follow "the process" and not "confront" anyone, even when you are right. And each and every one of these directives has its roots in political correctness; which I'll just go ahead and say that it's just "rebranding" conservatism.