Skip to content

Instantly share code, notes, and snippets.

View lsdr's full-sized avatar

Luiz Rocha lsdr

  • São Paulo, Brazil
  • 08:33 (UTC -03:00)
View GitHub Profile
@lsdr
lsdr / 01-console-output-broken-rails
Last active August 29, 2015 14:13
Problem with azk and postgresql
$ azk start
[ ... snip ...]
azk: Installing sass 3.4.9
azk: Installing sass-rails 5.0.1
azk: Installing spring 1.2.0
azk: Installing uglifier 2.6.0
azk: Installing web-console 2.0.0
azk: Your bundle is complete!
azk: It was installed into /azk/bundler
azk: postgres_development already exists
$ azk start
azk: ↑ starting `postgres` system, 1 new instances...
azk: ✓ checking `wyaeld/postgres:9.3` image...
azk: ⇲ downloading `wyaeld/postgres:9.3` image...
3a831d2c7eb9: Download completeazk: ◴ waiting start `postgres` system, try connect port data/tcp...
azk: ↑ starting `gaveteiro-frontend` system, 2 new instances...
azk: ✓ checking `rails:4.1` image...
azk: ⇲ downloading `rails:4.1` image...
de10a6ea16ef: Pull completeazk: ↻ provisioning `gaveteiro-frontend` system...
azk: ◴ waiting start `gaveteiro-frontend` system, try connect port http/tcp...
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
kooljobs: {
shell: "/bin/bash",
// Dependent systems
depends: ["redis"],
@lsdr
lsdr / NEATEvolve.lua
Last active August 11, 2018 12:52
MarI/O: the script that learns how to play Mario Bros/Mario Kart
-- MarI/O by SethBling
-- Feel free to use this code, but please do not redistribute it.
-- Intended for use with the BizHawk emulator and Super Mario World or Super Mario Bros. ROM.
-- For SMW, make sure you have a save state named "DP1.state" at the beginning of a level,
-- and put a copy in both the Lua folder and the root directory of BizHawk.
if gameinfo.getromname() == "Super Mario World (USA)" then
Filename = "DP1.state"
ButtonNames = {
"A",
@lsdr
lsdr / neovim-setup.md
Created February 2, 2016 11:58 — forked from adamzaninovich/neovim-setup.md
How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

How to get an awesome neovim setup that runs tests asynchronously in a neoterm split

Example

Installing neovim

brew install neovim/neovim/neovim
@lsdr
lsdr / config.js
Created April 12, 2017 19:00
Gaveteiro CKEditor Config
// CKEditor configuration - Gaveteiro
// referencia: http://docs.ckeditor.com/#!/api/CKEDITOR.config
// https://github.com/galetahub/ckeditor#customize-ckeditor
CKEDITOR.editorConfig = function( config )
{
config.language = 'pt-br';
config.height = 250;
config.allowedContent = true;

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

@lsdr
lsdr / palindromic_primes.rb
Created March 3, 2018 20:53
Random code challenge scripts and stuff like that
# Enter your code here. Read input from STDIN. Print output to STDOUT
require 'prime'
def ppn(n)
Prime.each(Float::INFINITY).lazy.select do |p|
p if p.to_s == p.to_s.reverse
end.first(n.to_i)
end
@lsdr
lsdr / ibge.sh
Last active August 18, 2024 13:54
Carregando dados do IBGE no PostGIS
# download dos shapefiles do IBGE
curl -s 'ftp://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_municipais/municipio_2016/Brasil/BR/BR.zip' -o BR.zip
# abrir o pacote
unzip -j BR.zip
# instala o postgresql e o postgis
brew install postgis
# inicia o postgresql
@lsdr
lsdr / docker_cheatsheet.md
Last active December 2, 2019 18:27
Docker Cheatsheet for the ages!

stop all running containers

docker ps | awk 'NR>1 {print $1}' | xargs docker stop

Brute force; list all and try to stop everything

docker ps -aq | xargs docker stop