Skip to content

Instantly share code, notes, and snippets.

@heronmedeiros
heronmedeiros / apple-search.css
Created August 14, 2012 03:20
input search like apple
form {
}
form input[type="text"] {
background: url(images/search.png) no-repeat 10px 6px #fcfcfc;
border: 1px solid #d1d1d1;
font: bold 12px Arial,Helvetica,Sans-serif;
color: #bebebe;
width: 150px;
@heronmedeiros
heronmedeiros / .vimrc
Created August 14, 2012 14:19
vimrc ubuntu
source /home/heron/.vim/vimrc
"Shortcut to rapidly toggle `set list`
nmap <leader>l :set list!<CR>
"Map \s as show git status
nmap <leader>s :Gstatus<CR>
" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\ ,eol:¬,trail:-
@heronmedeiros
heronmedeiros / raskell.rb
Created August 19, 2012 02:52 — forked from andkerosine/raskell.rb
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
class Klass
def self.foo
File.open "filename", "w" do |file|
file.write("text")
end
end
end
@heronmedeiros
heronmedeiros / .tmux.conf
Created October 27, 2012 20:44
tmux configuration
# set C-a as PREFIX
set -g prefix C-a
# set delay for other programs
set -s escape-time 1
#set index start by 1 for window
set -g base-index 1
#set index start by 1 for panes
@heronmedeiros
heronmedeiros / reduce.clj
Created November 7, 2012 20:19
reduce example
(defn plus [alpha beta] (+ alpha beta))
(plus 3 4) ;; 7
(plus 3 [4 5]) ;; Exception
(reduce plus 3 [4 5] ) ;; 12
;;yay
@heronmedeiros
heronmedeiros / jquery.ba-tinypubsub.js
Created November 12, 2012 13:59 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
Ext.define('Book', {
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name: 'title', type: 'string'},
{name: 'thumb_image_path', type: 'string'},
{name: 'user_id', type: 'int'}
],
proxy: { url: "/books", type: 'rest', format: "json" }
});
var a = "teste"
, b = 10
, variable = new Something()
;
@heronmedeiros
heronmedeiros / exfat.sh
Created July 28, 2014 16:59
exfat support on ubuntu
sudo apt-add-repository ppa:relan/exfat
sudo apt-get update
sudo apt-get install fuse-exfat