Skip to content

Instantly share code, notes, and snippets.

View mpereira's full-sized avatar

Murilo Pereira mpereira

View GitHub Profile
unbindall
bind "0" "+dota_control_group 10"
bind "1" "+dota_camera_follow"
bind "2" "+dota_control_group 2"
bind "3" "+dota_control_group 3"
bind "4" "+dota_control_group 4"
bind "5" "+dota_control_group 5"
bind "6" "+dota_control_group 6"
bind "7" "+dota_control_group 7"
bind "8" "+dota_control_group 8"
Running Steam on ubuntu 13.04 64-bit
STEAM_RUNTIME is enabled automatically
Running Steam on ubuntu 13.04 64-bit
STEAM_RUNTIME has been set by the user to: /home/murilo/.local/share/Steam/ubuntu12_32/steam-runtime
[2013-08-03 22:47:28] Startup - updater built Jul 26 2013 14:20:54
[2013-08-03 22:47:28] Verifying installation...
[2013-08-03 22:47:29] Verification complete
Shutting down. . .
[2013-08-03 22:47:42] Shutdown
Running Steam on ubuntu 13.04 64-bit
WARNING: unable to link dev_simulate_gcdown and dev_simulate_gcdown because one or more is a ConCommand.
Error: Material "debug/debugluxels" uses unknown shader "DebugLuxels"
Error: Material "___fillrate_0" uses unknown shader "FillRate"
Error: Material "___debugnormalmap_1" uses unknown shader "DebugNormalMap"
Error: Material "___debugdrawenvmapmask_2" uses unknown shader "DebugDrawEnvmapMask"
Error: Material "___debugdepth_3" uses unknown shader "DebugDepth"
Error: Material "___debugdepth_4" uses unknown shader "DebugDepth"
Failed to load image for cursor from /home/murilo/.local/share/Steam/SteamApps/common/dota 2 beta/dota/resource/cursor/cursor_inivisible.bmp: Couldn't open /home/murilo/.local/share/Steam/SteamApps/common/dota 2 beta/dota/resource/cursor/cursor_inivisible.bmp
Can't use cheat cvar snd_voip_center_speaker_vol in multiplayer, unless the server has sv_cheats set to 1.
Requested non-existent write path BASE_PATH!
[ 7.114]
X.Org X Server 1.13.4
Release Date: 2013-04-17
[ 7.114] X Protocol Version 11, Revision 0
[ 7.114] Build Operating System: Linux 2.6.24-32-xen x86_64 Ubuntu
[ 7.114] Current Operating System: Linux pluto 3.8.0-27-generic #40-Ubuntu SMP Tue Jul 9 00:17:05 UTC 2013 x86_64
[ 7.114] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.8.0-27-generic root=UUID=12054a51-399c-4846-a704-1d3fecf982ab ro modprobe.blacklist=xhci_hcd quiet splash vt.handoff=7
[ 7.114] Build Date: 08 May 2013 02:34:03PM
[ 7.114] xorg-server 2:1.13.4~git20130508+server-1.13-branch.10c42f57-0ubuntu0ricotz~raring (For technical support please see http://www.ubuntu.com/support)
[ 7.114] Current version of pixman: 0.28.2
name of display: :0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_multisample, GLX_EXT_create_context_es2_profile,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info,
GLX_EXT_visual_rating, GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer,
@mpereira
mpereira / gist:3072187
Created July 8, 2012 18:26
A little help to stop unconsciously checking distracting web sites.
alias focus="sudo sh -c \"echo '127.0.0.1 www.facebook.com twitter.com mail.google.com # aab6de513ab5de9359809f3cdb62d352' >> /etc/hosts\""
alias unfocus='sudo sed -i "" "/aab6de513ab5de9359809f3cdb62d352/d" /etc/hosts'
#include <gtk/gtk.h>
#include <libappindicator/app-indicator.h>
int main(int argc, char **argv) {
gtk_init(&argc, &argv);
AppIndicator *app_indicator;
app_indicator = app_indicator_new("foo",
"",
APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
# Add all gems in the global gemset to the $LOAD_PATH so they can be used even
# in bundled ruby projects without declaring them in the Gemfile.
if defined?(::Bundler)
$LOAD_PATH.concat(Dir.glob("#{ENV['rvm_ruby_global_gems_path']}/gems/*/lib"))
end

Remove trailing whitespace, convert tabs to spaces and file format to unix (remove ugly ^M carriage returns) from files using a single command:

vim -es -c 'set et ts=2 | bufdo retab | %s/\s\+$//e | set ff=unix | w' -c 'q' FILES

You could get your FILES using find

vim -es -c 'set et ts=2 | bufdo retab | %s/\s\+$//e | set ff=unix | w' -c 'q' $(find scripts -name '*.sh' -type f)

If in doubt, ask man.

battle_cries = [{ king_leonidas: 'This is where we fight! This is where they die!' },
{ he_man: 'By the power of Greyskull... I have the powerrr!' },
{ sindel: 'You are pathetic and weak.' },
{ shang_tsung: 'Your soul is mine!' },
{ klingons: 'Today is a good day to die!' }]
def from_mortal_kombat?(battle_cry)
[:sindel, :shang_tsung].include?(battle_cry.keys.first)
end