Skip to content

Instantly share code, notes, and snippets.

View klebervirgilio's full-sized avatar
🎯
Focusing

Kleber Correia klebervirgilio

🎯
Focusing
View GitHub Profile
@klebervirgilio
klebervirgilio / data-html-chosen.jquery.js
Created November 10, 2015 04:27
Adds the ability to render html in the list.
$ = jQuery;
$.fn.extend({
chosenDataHtml: function(options) {
return this.each(function(input_field) {
var $this = $(this),
formatSelection = options['formatSelection'] || function(e, data) {
var chosen = data.chosen,
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
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="
klebervirgilio@gmail.com
# [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]
]
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
#!/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

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 01:08
First AngularJS TODO App
<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>

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: