Skip to content

Instantly share code, notes, and snippets.

View bltavares's full-sized avatar
💭
I may be slow to respond.

Bruno Tavares bltavares

💭
I may be slow to respond.
View GitHub Profile
#!/bin/bash
password_file=$1
update_account() {
USERNAME=$1
PASSWORD=$2
FILE=$3
awk -i inplace "/username: '$USERNAME'/ { print \$0; getline; \$2="'$PASSWORD'" } { print \$0 }" $FILE
# encoding: utf-8
def 🐣(🐣🐣)
🐣🐣 + 🐣🐣
end
🐣 🐣('🐣')
au BufNewFile,BufRead *.js syntax match jsNot /!/ conceal cchar=¬
au BufNewFile,BufRead *.js syntax match jsOr /||/ conceal cchar=∨
au BufNewFile,BufRead *.js syntax match jsAnd /&&/ conceal cchar=∧
au BufNewFile,BufRead *.js syntax match jsEqual /===/ conceal cchar=↔
@bltavares
bltavares / timestamper.go
Last active August 29, 2015 14:04
Timestamper
package main
import (
"bufio"
"fmt"
"os"
"time"
)
func main() {
@bltavares
bltavares / spars.clj
Last active August 29, 2015 14:04
Sparklines
(ns sparks.core)
(def ticks '[▁ ▂ ▃ ▄ ▅ ▆ ▇ █])
(defn scale [smallest biggest x]
(inc
(/
(* (dec (count ticks)) (- x smallest))
(max (- biggest smallest) 1))))
@bltavares
bltavares / README.md
Last active January 3, 2019 20:29
Clojure
require 'minitest/autorun'
require 'truco'
include Truco
describe Truco::Card do
it 'has a suit' do
card = Card.new(1, Suits[:hearts])
assert_equal(card.suit, Suits[:hearts])
end
env X="() { :;} ; echo busted" /bin/sh -c "echo completed"
env X="() { :;} ; echo busted" `which bash` -c "echo completed"
@bltavares
bltavares / ratio.go
Created October 17, 2014 14:28
Contributor stats
package main
import (
"code.google.com/p/goauth2/oauth"
"fmt"
"github.com/google/go-github/github"
"os"
"strconv"
)