Skip to content

Instantly share code, notes, and snippets.

Requires jquery (not included)
<script src="jquery.js"></script>
Include gNius library
<script src="gNius.js"></script>
Your application data:
<script>
var articles = [
{ title: "gNius Library launched!", icon: "gNius.png", summary: "Lorem ipsum..." },
function message(){
return (({
close: function(){
for (var e, i=arguments.length;i;)
if (e = document.getElementById('gravity_magellan_' + arguments[--i]))
try{ document.body.removeChild(e) }catch(e){}
},
next: function(){
debugger;
if (document.createEventObject){
<!doctype html>
<title>Create-A-Vehicle</title>
<body>
<input id=name />
<select id=type>
<option selected value=Car>Car</option>
<option value=Motorcycle>Motorcycle</option>
</select>
@brito
brito / socialism.css
Created November 29, 2011 23:07
A twitter + facebook connection wrapper.
[data-state=disconnected] legend:after { content:'connect' }
[data-state=connected] legend:after { content:'disconnect' }
[data-state=disconnecting] legend:after { content:'cancel' }
.connect, .connected, .disconnecting { display:none }
[data-state=connected] .connected,
[data-state=disconnected] .connect,
[data-state=disconnecting] .disconnecting { display:block }
@brito
brito / $.carousel.js
Created February 5, 2012 03:38
carousel
@brito
brito / dabblet.css
Created March 2, 2012 21:17
External link decorator
/**
* External link decorator
*/
a[href^="http"]:after {
content: url(data:image/png;base64,R0lGODlhCQAMAMQAAPr7/Cpdi6q/0X2duURxmjRlkfz9/vz8/TVlkae8z4+qwoWivTlplDVmkvv8/Up1nUVymvn6/LrL2i1gjStejKS6zkNwmUFvmD5slkJwmbjJ2DZnkqm90Cdbiv///wAAACH5BAEAAB4ALAAAAAAJAAwAAAU6oCeOY7R0aNoByWURQUoOMTpqD0p1Ird1hEGGJ/gVJB5Ip9gpcESYDqOD4BxEFcWkwTGMHACSeDwKAQA7);
padding-left: 2px;
}
@brito
brito / tabindex-retrofit.js
Created March 27, 2012 20:57
An edge case where html is impossible given custom JSP tags
// field selectors, in this case by name
names = ['name', 'last_name', 'age'];
$.each(names, function(i, name){
$('[name="'+name+'"]').attr('tabindex', i);
});
// In theory this should just be HTML, but the default setting for human is "stupid"
// http://dev.w3.org/html5/spec/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
@brito
brito / dabblet.css
Created March 28, 2012 06:48
perspective
/* perspective */
* { transition:all 250ms }
body { perspective:1em; font-size:400px }
@keyframes r3d {
0%, 100% { /*transform:rotateX(137deg);*/
background:hsla(0,100%,50%,1);
transform:scale(1) }
38% { /*transform:rotateY(137deg);*/
background:hsla(137,100%,50%,.38);
@brito
brito / dabblet.css
Created April 5, 2012 03:00
perspective: momentum-space
/* perspective: momentum-space */
* { transition:all 24.9ms linear }
body { perspective:.6em; font-size:400px;
background:#000 }
@keyframes spin {
38.1% { transform:rotateX();
border-radius:2.618em }}
section { background:hsla(222.45,61.8%,38.1%,.3);
@brito
brito / dabblet.css
Created April 11, 2012 19:58
Series Image
/*
* Series Image
*/
img { box-shadow:-3px 0 3px rgba(0,0,0,.4) }
img + img { margin-left:-140px }