Skip to content

Instantly share code, notes, and snippets.

View ruliana's full-sized avatar

Ronie Uliana ruliana

View GitHub Profile
@ruliana
ruliana / test.dot
Created November 20, 2013 02:45
GraphViz file tiny example
digraph g {
rankdir = BT
node [shape = ellipse, style = filled, fillcolor = white, fontsize = 10];
edge [arrowhead = open, fontsize = 8];
// Hierarquia
"Programador" -> "Analista de Sistemas";
"Programador" -> "Coordenador de Projetos";
"Desenvolvedor" -> "Analista de Sistemas";
"Desenvolvedor" -> "Coordenador de Projetos";
# General
# set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set -g base-index 1
set -g pane-base-index 1
set -g prefix C-a
set -s escape-time 0
set -g set-titles on
set -g mode-keys vi
#set -g set-titles-string ' #(__git_ps1) '
set -g status-interval 2
@ruliana
ruliana / bimax.jl
Last active March 14, 2022 09:08
BIMAX in Julia (Biclustering Algorithm)
# References:
# Original Paper: http://ocw.metu.edu.tr/file.php/40/Schedule/reading8.pdf
# Original Algorithm: http://www.tik.ee.ethz.ch/sop/bimax/SupplementaryMaterial/supplement.pdf
# Explained for Humans: http://www.kemaleren.com/the-bimax-algorithm.html
typealias VVector{T} Vector{Vector{T}}
function bimax(m::Matrix{Int})
z = Vector{Int}[]
rows = 1:size(m, 1)
@ruliana
ruliana / Dockerfile
Created April 15, 2014 17:53
Dockerfile for Neo4J on Arch Linux
# Base Arch with base-devel and yaourt
FROM base/devel
MAINTAINER Ronie Uliana, ronie.uliana@vagas.com.br
# Installing Neo4J using Yaourt
RUN yaourt -Sy --noconfirm neo4j
RUN /usr/bin/sed -i.back 's/^#\(org\.neo4j\.server\.webserver\.address.*\)/\1/' /etc/neo4j/neo4j-server.properties
ENTRYPOINT ["/usr/bin/neo4j", "console"]
private
# Truque sujo para compilar um método com
# tail call optimization ligado :)
RubyVM::InstructionSequence.new(<<-RUBY, nil, nil, nil, tailcall_optimization: true, trace_instruction: false).eval
def separar_comuns(restantes, atual, resultado)
return resultado if restantes.empty?
primeiro, *resto = restantes
*_, ultimo= atual
@ruliana
ruliana / load_with_tco.rb
Created September 4, 2014 21:14
Load a ruby file compiling it with tail call optimization, with no effects in the rest of the system.
# Require a file compiling it
# with tail call optimization.
def load_with_tco(file)
def find(f)
filename = f + '.rb'
$LOAD_PATH.lazy.map do |path|
File.join(path, filename)
end.find do |path|
File.exist?(path)
end
@ruliana
ruliana / Guardfile
Created September 5, 2014 16:15
My guarfile
guard :rspec, cmd: 'bundle exec rspec', all_on_start: true, keep: true, all_after_pass: true, run_all: { cmd: 'bundle exec rspec -f progress' } do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
watch('lib/kremer.rb') { "spec" }
end
@ruliana
ruliana / time_lapse.sh
Created November 20, 2014 14:49
Photos => Time Lapse Video (GoPro with Linux and zsh)
# ZSH only
print -rl **/*(.Om) > frames.txt
mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect:vqscale=3 -vf scale=1920:1080 -mf type=jpeg:fps=24 mf://@frames.txt -o time-lapse.avi
@ruliana
ruliana / SMTP
Last active August 29, 2015 14:10
SMTP testing using telnet or ncat
# telnet localhost smtp
# ncat localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 fbreveal.com ESMTP Sendmail 8.13.8/8.13.8; Tue, 22 Oct 2013 05:05:59 -0400
>HELO yahoo.com
250 tecadmin.net Hello tecadmin.net [127.0.0.1], pleased to meet you
>mail from: sender@tecadmin.net
@ruliana
ruliana / local-http-file.sh
Created January 28, 2015 02:46
Serve a local file as http (once only)
{ echo -ne "HTTP/1.0 200 OK\r\nContent-Type:text/plain;Charset=utf-8\r\nContent-Length: $(wc -c <some.file)\r\n\r\n"; cat some.file; } | nc -l -p 8080