Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Kleber Correia klebervirgilio

🎯
Focusing
View GitHub Profile
View usd2brl.go
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
View usd2brl.js
var http = require('http'),
request = require('request');
x = '',
port = process.env.PORT || 8080;
http.createServer(function(req, response) {
http.get({
host: 'query.yahooapis.com',
path: "/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%27www.google.com%2Ffinance%2Fconverter%3Fa%3D1%26from%3DUSD%26to%3DBRL%27%20and%20xpath%3D%27%2F%2F*%5B%40id%3D" + '"currency_converter_result"' + "%5D%2Fspan%2Ftext()%27&format=json&callback="
View pac.rb
# [altura, largura, comprimento, peso]
products = [
[28.0, 44.0, 33.0, 4],
[29.0, 44.0, 33.0, 17],
[50.0, 100.0, 50.0, 10],
[106, 40 , 20, 4],
[70, 70, 70, 20],
[66.65, 66.65, 66.65, 6.6],
[10, 1, 1, 7.5]
]
View my-day.sh
autoload -U colors && colors
HOUR=`date +"%k"`
function _is_current_ () {
if [[ $1 =~ ([0-9]{1,2})h([[:space:]]-[[:space:]])?([0-9]{1,2})?h? ]]; then
start=$match[1];
end=$match[3];
if [ -z $end ]; then
if [[ $HOUR -eq $start ]]; then
View worm.rb
#!/usr/bin/env ruby
require 'gosu' # gem install gosu --no-document
include Gosu
$dimension, $splits = 200, 20
$size = $dimension.to_f / $splits.to_f
class Worm
attr_writer :dir
def initialize() reset end
View upgrading-vagrant-fusion.mdown

I had some headaches yesterday while trying to upgrade to VMWare Fusion with Vagrant.

The steps that work are:

  • export your boxes from Virtualbox to OVA files
  • run 'vagrant destroy' on all your boxes
  • uninstall Virtualbox using the uninstaller script in the installer DMG
  • download VMWare Fusion
  • run 'vagrant plugin install vagrant-vmware-fusion' to install the provider plugin
  • run 'vagrant plugin license vagrant-vmware-fusion license.lic' to install the license you just bought
@klebervirgilio
klebervirgilio / ng.html
Created May 4, 2013
First AngularJS TODO App
View ng.html
<html ng-app="PomoDo" >
<head>
<title>NG</title>
</head>
<body>
<div id="done" ng-controller="TaskController">
<form>
<label>
Task Titlte (<span>{{tasks.length}}</span>)
</label>
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

View clear_float.css
/* clearfix */
.group:before,
.group:after {
content: "";
display: table;
}
.group:after {
clear: both;
}