Skip to content

Instantly share code, notes, and snippets.

View mpereira's full-sized avatar

Murilo Pereira mpereira

View GitHub Profile
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
# encoding: utf-8
# Copyright (C) 2011 by Murilo Pereira <murilo@murilopereira.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

If you want to do something like

Then the output should contain "\"bob saget\",1234123412"

This is the step definition you would probably write

Then /^the output should contain "(.*)$" do |text|
  Output.string.should be_include(text)