Skip to content

Instantly share code, notes, and snippets.

View alfredormz's full-sized avatar
:octocat:

Alfredo Ramírez alfredormz

:octocat:
View GitHub Profile
@alfredormz
alfredormz / faster-show-hide
Last active February 9, 2018 14:41
Faster show/hide Dock
defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock
@alfredormz
alfredormz / set_brightness.sh
Created February 9, 2018 12:33
Change LCD brightness from command line in Linux
xrandr -q | grep " connected"
#LVDS-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
xrandr --output LVDS-1 --brightness 0.8

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@alfredormz
alfredormz / ordered_branches1.sh
Created November 27, 2017 18:11
List git branches, ordered by most recent commit
for k in `git branch | sed s/^..//`; do
echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" "$k"`\\t"$k";
done | sort -r
@alfredormz
alfredormz / database_size.sql
Created April 17, 2014 13:53
MySQL database size
SELECT table_schema "Database",
SUM(data_length + index_length) / 1024 / 1024 AS "Size in MB"
FROM information_schema.TABLES
GROUP BY table_schema;
@alfredormz
alfredormz / frankenstein.sh
Created January 29, 2014 15:46
Crea un reporte con la cantidad de elementos distintos de un tag xml dentro de un conjunto de archivos xml
for file in *.xml; do xmlstarlet fo -R -Q $file; done | grep \<xml_tag\> | sort | uniq -c | sort -g | ruby -ne 'puts $_.gsub(/<\/?xml_tag\>/, "")'
# 26 Temporada
# 28 Corporativa
# 84 Rural
# 185 Industrial
# 2111 Comercial
# 19546 Residencial

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@alfredormz
alfredormz / gist:5980621
Created July 12, 2013 01:04
Ruby One Liner Webserver
ruby -run -e httpd . -p 5000
@alfredormz
alfredormz / das_downloader.rb
Created June 2, 2013 16:15
Script to download my Destroy All Software screencast collection
#! /usr/bin/env ruby
require 'mechanize'
#usage das_dowloader.rb [destination_path]
URL = "https://www.dropbox.com/sh/cy20e9npok91qc4/FxNKaTDdqE/das?lst"
path = ARGV[0] || "."
agent = Mechanize.new
agent.pluggable_parser.default = Mechanize::Download
@alfredormz
alfredormz / hidemenubar.sh
Last active December 17, 2015 10:59
Hides the gnome-terminal menu bar
gconftool --type boolean --set /apps/gnome-terminal/profiles/Default/default_show_menubar false