Skip to content

Instantly share code, notes, and snippets.

View thiagov's full-sized avatar

Thiago Silva Vilela thiagov

View GitHub Profile
@thiagov
thiagov / gh-pages-deploy.md
Last active March 28, 2018 15:24 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on some branch be the root directory of a repository’s master branch.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file.

@thiagov
thiagov / gist:2a1adb057a3469dedb453e98a2e3f5e9
Last active December 18, 2017 10:43
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev python3-dev libgtk2.0-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@thiagov
thiagov / delete_dups.rb
Created November 23, 2012 18:38
Remove suppliers repetidos pegos pelo crawler
h = Hash.new{|h, k| h[k] = []}
count = 0
size = SupplierProduct.count
SupplierProduct.all.each do |sup|
print "\rProduto #{count+=1}/#{size}"
obj = {:sup => sup.supplier, :code => sup.code}
h[obj].push(sup)
end
require "rubygems"
require "mongo"
include Mongo
FROM = ARGV[1] || "roxette_development"
TO = ARGV[2] || "bimbon"
EXPORT_INFO = {
:products => {