Skip to content

Instantly share code, notes, and snippets.

View ndrluis's full-sized avatar

Andre Luis Anastacio ndrluis

  • Belo Horizonte, MG - Brazil
  • 23:44 (UTC -03:00)
View GitHub Profile
@ndrluis
ndrluis / ux_referencias
Last active October 12, 2015 01:47 — forked from eshiota/ux_referencias
UX para Developers - Referências
# UX para Developers - Referências
## Soluções prontas
- jQuery Mobile (http://www.jquerymobile.com)
- HTML 5 Boilerplate (http://html5boilerplate.com)
## Ferramentas
- Spin.js (http://fgnass.github.com/spin.js)
@ndrluis
ndrluis / ruby.sh
Created October 31, 2012 19:59 — forked from fnando/ruby.sh
Install Ruby
#!/usr/bin/env bash
INSTALL_DIR="${INSTALL_DIR:-/opt/local}"
VERSION=$2
APP_NAME="ruby"
URL="http://ftp.ruby-lang.org/pub/ruby/ruby-$VERSION.tar.bz2"
PREFIX="$INSTALL_DIR/$APP_NAME/$VERSION"
CURRENT="$INSTALL_DIR/$APP_NAME/current"
TGZ="$INSTALL_DIR/src/$(basename $URL)"
COMMAND=$1
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hellobits"
config.vm.box_url = "http://hellobits.com/vagrant/hellobits.box"
config.vm.synced_folder ".", "/Projects", id: "vagrant-root"
# config.vm.network :private_network, ip: "192.168.50.2"
forward_port = ->(guest, host = guest) do
@ndrluis
ndrluis / awk_functions.awk
Created June 24, 2013 14:25
awk functions
# TRIM
function ltrim(s) { sub(/^[ \t]+/, "", s); return s }
function rtrim(s) { sub(/[ \t]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
@ndrluis
ndrluis / spedCfopCst.rb
Last active December 19, 2015 00:19
Scripts para correções de arquivos do Sped Fiscal
##
# Troca a CST dos registros C470/C490 de acordo com o CFOP
##
File.open(ARGV.first).each do |line|
row = line.split("|")
if row[1] == "C470"
row[7] = "060" if row[8] == "5656"
row[7] = "060" if row[8] == "5405"
row[7] = "000" if row[8] == "5102"
@ndrluis
ndrluis / script_nfp.rb
Last active December 23, 2015 19:59
Gera Update com as informações que se encontram na Nota Fiscal Paulista.
tributos = '0700120018002500020000000000000000000000000000000000000000000000'
Dir.glob("#{Dir.pwd}/cat52/*").each do |file|
total_tributos = Array.new(16,'0' * 14)
File.open(file,'r').each do |line|
serie_ecf ||= line[3..22]
andreanastacio @ ~/Workspace/src/ruby/ventriloquist/development
> vagrant destroy
You appear to be running Vagrant in a Bundler environment. Because
Vagrant should be run within installers (outside of Bundler), Vagrant
will assume that you're developing plugins and will change its behavior
in certain ways to better assist plugin development.
Are you sure you want to destroy the 'default' VM? [y/N] y
[default] Forcing shutdown of VM...
[default] Destroying VM and associated drives...
andreanastacio @ ~/Workspace/src/ruby/ventriloquist/development
> bundle
Resolving dependencies...
Using rake (10.1.0)
Using dependor (1.0.1)
Using bogus (0.1.4)
Using timers (1.1.0)
Using celluloid (0.15.2)
Using ffi (1.9.0)
Using childprocess (0.3.9)
andreanastacio @ ~/Workspace/src/ruby/ventriloquist/development
> vagrant up
You appear to be running Vagrant in a Bundler environment. Because
Vagrant should be run within installers (outside of Bundler), Vagrant
will assume that you're developing plugins and will change its behavior
in certain ways to better assist plugin development.
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
andreanastacio @ ~/Workspace/src/ruby/ventriloquist/development
> vagrant up
You appear to be running Vagrant in a Bundler environment. Because
Vagrant should be run within installers (outside of Bundler), Vagrant
will assume that you're developing plugins and will change its behavior
in certain ways to better assist plugin development.
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...