This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dependencies. | |
var express = require('express') | |
app = module.exports = express.createServer(), | |
del = function(req, res) { res.clearCookie('login_token'); res.redirect('/'); }, | |
set = function(req, res) { res.cookie('login_token', +new Date(), { maxAge: 3600000, path: '/' }); res.redirect('/'); }; | |
// Config | |
app.configure(function() { | |
app.use(express.bodyParser()); | |
app.use(express.cookieParser()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var images = $('#banner').children(); | |
images.filter(':eq(' + ~~(Math.random() * images.hide().length) + ')').show(); | |
setInterval(function() { | |
var current = images.filter(':visible').fadeOut(), | |
next = (current.next().length ? current.next() : images.eq(0)).fadeIn(); | |
}, 2000); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// What results can you get just using these characters: +[] | |
// I know this has been done before, but I don't have the link, | |
// and I don't want it (not yet, at least) | |
// basic numbers | |
0: +[] | |
1: ++[+[]][+[]] | |
2: ++[++[+[]][+[]]][+[]] | |
3: ++[++[++[+[]][+[]]][+[]]][+[]] | |
4: ++[++[++[++[+[]][+[]]][+[]]][+[]]][+[]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="javascript:(function(d,g,a,b,c,e,f,h,n,t,u,w,x){f=function(e,o,k){for(k in o)e.setAttribute(k,o[k])};c=function(e){return d.createElement(e)};n=function(s){return d.createTextNode(s)};a=function(e,c,k){for(k in c)e.appendChild(c[k])};w=c(g);h=c(g);t=n('Toggle Style-Elements');u=c('ul');b=d.querySelector('body');x='position:fixed;top:0;right:0;z-index:99999;margin:0;padding:0;background:#f4fff4;color:#99ad85;font:14px Helvetica,Arial,sans-serif;border:1px solid #bada55;border-top-width:0;border-right-width:0;border-bottom-left-radius:10px;';e=d.getElementById('tcss');if(b&&e)f(e,{style:x+(e.style.display=='none'?'':'display:none')});else if(b){f(w,{id:'tcss',style:x});f(h,{style:'font:20px Georgia,serif;padding:10px;margin:0;background:#dae7da;color:#693'});f(u,{style:'margin:0;padding:10px;list-style-type:disc'});f(u,{style:'margin:0;padding:10px;list-style-type:disc;'});a(b,[w]);a(w,[h,u]);a(h,[t]);[].slice.call(d.styleSheets).forEach(function(s,i,l,m,y,z){y='margin:0 0 0 20px;padding:0;cursor:point |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Opera Bug (SVG Data URI background, border-radius and scrolling) | |
*/ | |
.icon { | |
display: inline-block; | |
width: 128px; | |
height: 128px; | |
margin: 20px 20px 20px 0; | |
background-color: #eee; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
options=('find' 'delete') | |
PS3='state your wish: ' | |
echo -e "\nfind/delete corrupt whisper-files" | |
select opt in "${options[@]}"; do | |
case $REPLY in | |
[12] ) option=$opt; break;; | |
* ) exit;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html5> | |
<html> | |
<head> | |
<style> | |
#box { height: 250px; -webkit-transition: all 5s; -moz-transition: all 5s; } | |
</style> | |
<script> | |
window.addEventListener('DOMContentLoaded', function() { | |
console.log('DOMContentLoaded!'); | |
}, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<svg xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<a> | |
<text y="1em">Click me</text> | |
<animate attributeName="xlink:href" values="#;#;#;#;#;javascript:alert('Bang!')" begin="0s" dur="0.1s" fill="freeze" repeatCount="indefinite"/> | |
</a> | |
</svg> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TodoModel | |
constructor: -> | |
@todos = [] | |
@callbacks = [] | |
add: (name) -> | |
@todos.push name: name, completed: false | |
@handleChange 'add', name | |
onChange: (callback) -> | |
@callbacks.push callback | |
handleChange: (type, value) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.outer { | |
height: 400px; | |
overflow: auto; | |
position: relative; | |
width: 200px; | |
} | |
.inner { | |
height: 1200px; | |
zoom: 1; | |
} |
OlderNewer