Skip to content

Instantly share code, notes, and snippets.

View salgadobreno's full-sized avatar

Breno Santos Salgado salgadobreno

  • Origem Motos
  • Brasília, Brazil
View GitHub Profile
@mengtongun
mengtongun / Mouse Scroll Wheel Speed Setting in Ubuntu
Created October 19, 2021 02:28
Adjust the mouse wheel speed in Ubuntu by using a line of script
Just run this script you can adjust the value of the speed. Thanks to the creator! nicknorton.net
bash <(curl -s nicknorton.net/mousewheel.sh)
require "json"
require "digest"
require "logger"
class SlowQueryLogger
def initialize(output = nil, opts = {})
# will log any query slower than 500 ms
@threshold = opts.fetch(:threshold, "500").to_i
@logger = Logger.new(output || STDOUT)
@Overbryd
Overbryd / 1_example.rb
Last active June 2, 2022 10:27
Sexiest assertion since I started testing APIs: assert_structure
# lets say this is the response we receive
response = {
"results" => {
"total_count" => 15,
"per_page" => 100,
"companies" => [
{
"company" => {
"name" => "Foo Bar Ltd",
"registered_address" => { ... },
@sedm0784
sedm0784 / CapsLockCtrlEscape.ahk
Last active April 11, 2024 22:38
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}
@javan
javan / screenshot.js
Created June 19, 2012 21:40
Create a screenshot of any URL using phantomjs (headless webkit)
//
// Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png
//
var system = require('system');
var url = system.args[1];
var filename = system.args[2];
var page = new WebPage();
page.open(url, function (status) {
@Swizec
Swizec / paragraph_counter.js
Created September 16, 2011 14:52
Simple script to see how far users scroll on a website
(function ($) {
$.waypoints.settings.scrollThrottle = 30;
try {
mpmetrics = new MixpanelLib("<api_key>");
} catch(err) {
var null_fn = function () {};
mpmetrics = {
track: null_fn,
track_funnel: null_fn,
@salgadobreno
salgadobreno / wtf-linkedin.rb
Created June 2, 2011 20:47
One day I thought I'd save that linkedin business segments list so I could exercise business options but I saved the whole html node instead.. then I saw that it were OVER 9000(!) characters in just one line so I did a .rb to get what I wanted...(wtf)
mi = <<HEHE
<select name="industryChooser" id="industryChooser-lookingProfileForm"><option value="" selected="">-</option><option value="47" class="corp fin">Accounting</option><option value="94" class="man tech tran">Airlines/Aviation</option><option value="120" class="leg org">Alternative Dispute Resolution</option><option value="125" class="hlth">Alternative Medicine</option><option value="127" class="art med">Animation</option><option value="19" class="good">Apparel &amp; Fashion</option><option value="50" class="cons">Architecture &amp; Planning</option><option value="111" class="art med rec">Arts and Crafts</option><option value="53" class="man">Automotive</option><option value="52" class="gov man">Aviation &amp; Aerospace</option><option value="41" class="fin">Banking</option><option value="12" class="gov hlth tech">Biotechnology</option><option value="36" class="med rec">Broadcast Media</option><option value="49" class="cons">Building Materials</option><option value="138" class="corp man">Business Su
@danielres
danielres / ubuntu_server_config.sh
Created January 9, 2011 00:04
steps used to install a rails environment for development on my Ubuntu 10.10 server box
# based on:
# http://www.hackido.com/2010/12/install-ruby-on-rails-on-ubuntu.html
# http://thekindofme.wordpress.com/2010/10/24/rails-3-on-ubuntu-10-10-with-rvm-passenger-and-nginx/
# http://ascarter.net/2011/01/02/rails-development-on-ubuntu-10.10.html
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install build-essential
sudo apt-get install git-core