Skip to content

Instantly share code, notes, and snippets.

View ricardobeat's full-sized avatar

Ricardo Tomasi ricardobeat

View GitHub Profile
@ricardobeat
ricardobeat / intro.md
Created July 12, 2013 02:04
Powerline-style bash prompt
<script>
document.body.addEventListener('click', function(e){
if (e.target.tagName.toLowerCase() !== 'a' || !e.target.href) return
_gaq.push(['_trackEvent', 'Outbound Links' , e.target.href])
}, false)
</script>
return template.replace(/\{\{([\s\|\w]+)\}\}/g, function(m, parts){
var parts = parts.split('|'), value = comment[parts.pop()] || '', filter
while (filter = parts.pop()) value = CommentBox.filters[filter](value)
return value
})
@ricardobeat
ricardobeat / should.coffee
Last active December 18, 2015 02:29
freestyle coffeescript BDD
_global = global ? window ? this
constructorOf = (obj) ->
Object::toString.call(obj).match(/\s(\w+)\]$/)?[1]
# -----------------------------------------------------------------------------
class Op
constructor: (@type, @value) ->
@expected = true
flour = require 'flour'
async = require 'cake-async'
tempFiles = [
'build/scripts/deps.min.js'
'build/scripts/angular.min.js'
'build/scripts/scripts.min.js'
]
async task 'build:deps', (o, done) ->
@ricardobeat
ricardobeat / node-paas.md
Created April 30, 2013 22:21
node PaaS comparison
Provider RAM Disk Price
= 2013
<10 35
11-15 16
16-20 189
21-25 614
26-30 593
31-35 343
36-40 160
41-45 73
46-50 33
var models = [model1, ...]
, results = []
, total = 0
models.forEach(function(model, i){
model.count().exec(function(err, count){
results[i] = count
if (++total === models.length) {
res.render('painel/info', {
title: 'Informações',
@ricardobeat
ricardobeat / count.js
Last active December 16, 2015 02:59 — forked from alanhoff/gist:5366411
var async = require('async')
models = [model1, ...]
async.map(models, function(model, next){
model.count().exec(next)
}, function(err, count){
res.render('painel/info', {
title: 'Informações',
subtitle: 'Geral',
@ricardobeat
ricardobeat / index.html
Created April 9, 2013 05:17
HN's favorite tech talks
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HN's favorite tech talks</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1>HN's favorite tech talks</h1>
<ul>