Skip to content

Instantly share code, notes, and snippets.

@altherlex
altherlex / alter_clipboard.ahk
Created May 20, 2015 23:26
alter_clipboard.ahk
;^c::
#Persistent
return
OnClipboardChange:
ClipWait
StringReplace, clipboard, clipboard, STRING_REPLACE, STR , All
clipboard = %clipboard%
return
@altherlex
altherlex / notes.txt
Last active August 29, 2015 14:21
write down about nodejs and many awesome tools
#phantomjs
Make integration tests with phantomjs: http://phantomjs.org/
http://staal.io/blog/2013/08/17/incredibly-convenient-testing-of-frontend-javascript-with-node-dot-js/
#http://nightwatchjs.org/
#lambda3 (Giovanni Bassi)
http://blog.lambda3.com.br/
#jsdom
https://github.com/tmpvar/jsdom
@altherlex
altherlex / cmd_nodejs.js
Last active August 29, 2015 14:20
cmds nodejs
//Automatic re-running with nodemon and npm server
nodemon -x 'npm start'
//or
node app.js
//Start mongodb
mongod --dbpath C:\mongodb\data\db
@altherlex
altherlex / test_spec.rb
Created May 4, 2015 18:24
subject, specify, let
#http://stackoverflow.com/questions/9778657/why-does-this-simple-rspec-string-equality-spec-fail
describe First do
specify { First.new.to_s.should == "Hello World" }
end
describe First do
describe "#to_s" do
subject { First.new.to_s }
it { should == "Hello World" }
end
@altherlex
altherlex / nodejs_benchmark.rb
Created May 3, 2015 05:20
Nodejs benchmark
# Testing Scaling
require 'benchmark'
n = 10000
result = Benchmark.bm do |x|
x.report { for i in 1..n; Thread.new {`curl -XGET http://localhost:3000`}; end }
end
@altherlex
altherlex / Malha-Logistica.md
Last active August 29, 2015 14:19
Malha-Logistica
@altherlex
altherlex / my_comands.MD
Created April 9, 2015 18:38
my comands

h1. Meus comandos

for i in $(find -name '.');do file $i;done |grep UTF

#!/bin/bash
for i in $(find -name '*.*');do iconv -f iso-8859-1 -t UTF-8 -o $i $i;done
#do encoding=$(file -bi $i | sed -e 's/.*[ ]charset=//');
do iconv -f iso-8859-1 -t UTF-8 -o $i $i;done
-----------------------------------------
@altherlex
altherlex / test_watir-gem.rb
Created March 27, 2015 10:53
Gem Watir for automating test
# encoding: UTF-8
#http://watir.com/
#https://github.com/watir/watir/
require 'rubygems'
require "watir"
teste_site = "http://blogsearch.google.com.br/"
browser = Watir::IE.new
browser.goto teste_site
@altherlex
altherlex / combine_anagrams.rb
Created March 24, 2015 18:58
Exercise solve for ruby beginners
# encoding: UTF-8
# Exercise description: http://goo.gl/2XsKhW
require 'minitest'
require "minitest/autorun"
############### Exercise 3 ##############
class Array
def combine_anagrams
self.group_by{|el| el.downcase.chars.sort}.values
end
@altherlex
altherlex / salmpe+html.md
Created March 23, 2015 16:24
Sampe html code for initial course