Skip to content

Instantly share code, notes, and snippets.

View FiXato's full-sized avatar

Filip H.F. "FiXato" Slagter FiXato

View GitHub Profile
class Mage < Player
def initialize(*args)
super(*args)
@str, @int, @dex = 1, 6, 2
end
def level_up
@str += 1
@int += 6
@dex += 2
@FiXato
FiXato / bash_prompt_with_git_and_rbenv.sh
Last active August 29, 2015 13:57 — forked from kyanny/gist:1668822
Updated original bash prompt with git and rbenv example with a check for the __git_ps1 function instead of existence of a git bash-completion file.
# rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
source ~/.rbenv/completions/rbenv.bash
# prompt with ruby version
# rbenv version | sed -e 's/ .*//'
__rbenv_ps1 ()
{
rbenv_ruby_version=`rbenv version | sed -e 's/ .*//'`
@FiXato
FiXato / router_statistics.rb
Created September 20, 2013 01:18
Simple Ruby script to retrieve some useful Internet connexion statistics from a Siemens Gigaset sx762 modem/router. By default it only returns the Up- and Down-stream statistics, External IP & MAC addresses and Uptime, but if you pass the --verbose argument, you get the raw data back as well.
#!/usr/bin/env ruby
# router_statistics.rb: Simple Ruby script to retrieve some useful Internet connexion statistics from a Siemens Gigaset sx762 modem/router
# (c) 2013, Filip H.F. "FiXato" Slagter <[email protected]>
# By default it only returns the Up- and Down-stream statistics, External IP & MAC addresses and Uptime, but if you pass the --verbose argument, you get the raw data back as well.
#
# Sample output (with faked IP/MAC addresses):
# Siemens Gigaset sx762 Statistics:
# ================================================================================
# Up: 833 / 825 kbps [Attn: 408 dB / Noise: 56 dB / Pwr: 122 dBm]
# Down: 1309 / 1316 kpbs [Attn: 602 dB / Noise: 61 dB / Pwr: 149 dBm]
@FiXato
FiXato / rename_images_to_their_iptc_captions.rb
Last active December 22, 2015 16:49
Renames images to their IPTC captions, suffixing them with the original filename as well. Example: 1-bar.jpg => bar-to-the-awesome - 1-bar.jpg Very hacky, but it scratched my itch and might help someone else too. :)
# encoding: utf-8
# Renames images to their IPTC captions, suffixing them with the original filename as well.
# Example:
# 1-bar.jpg => bar-to-the-awesome - 1-bar.jpg
# Very hacky, but it scratched my itch and might help someone else too. :)
require 'fileutils'
require 'iptc'
FileUtils.cd("path/to/source/images")
output_dir = "renamed"
FileUtils.mkdir(output_dir) unless File.exist?(output_dir)

Chatmosphere hosts and the IPs they resolve to

app1.chatmosphere.org has address 69.41.179.202
app2.chatmosphere.org has address 69.41.179.203
app3.chatmosphere.org has address 69.41.179.204
app4.chatmosphere.org has address 69.41.179.205
app5.chatmosphere.org has address 69.41.179.206
app6.chatmosphere.org has address 69.41.165.98
app7.chatmosphere.org has address 69.41.165.99

app8.chatmosphere.org has address 69.41.165.100

@FiXato
FiXato / dont_be_sad.rb
Created June 26, 2013 00:32
Whenever I am sad, I stop being sad, and be awesome instead: https://www.youtube.com/watch?v=veINDSTr3r4
#!/usr/bin/env ruby
# encoding: utf-8
def sad?
@status == 'sad'
end
def stop_being_sad
puts "I stop being sad."
@status = ''
@FiXato
FiXato / google_plus_single_column_layout_fixes-mozformat.user.css
Last active December 18, 2015 13:19
CSS UserStyle fixes for the latest Google Plus layout as of 2013 Q3. So far only the single column layout is being tweaked.
@-moz-document domain("plus.google.com") {
#I_have_all_the_rules_prefixed_with_nonexisting_ids_to_describe_the_rules_and_to_enforce_correct_rule_orders_for_user_style_engines_that_strip_comments_and_sort_rules_alphabetically {}
}
@-moz-document domain("plus.google.com") {
#_Single_Column_Layout_Section_comment { /* The rules in this section apply to the single column layout */ }
#rule_1a_remove_fixed_width_on_content_columns, .ow > div, .ow .e4CL6 { width: inherit!important; }
#rule_1b_set_maximum_width_on_content_columns, .ow > div { max-width: /*[[max-column-width]]*/!important; }
@FiXato
FiXato / gamehelp.md
Last active December 18, 2015 07:18
Game Help page for Esper.net IRC network, guiding lost souls to the right channels, instead of bugging non-help channels.

EsperNet Game Help

Hello! You appear to be asking for help with a game in a channel that is not associated with any game whatsoever and thus you have been directed to this page. This page will guide you to the right place.

To join one of the channels suggested below, please use /join #channel, replacing #channel with the name of the channel you want to join. Don't forget the include the # though, as it is part of the name.

If you are new to IRC, there is a great article on workaround.org about asking for help on IRC.

Known Channels

@FiXato
FiXato / resdashboard.user.css
Created June 9, 2013 19:01
User.css stylesheet for the Reddit Enhancement Suite Dashboard, adding a 2 column layout as well as various other tweaks.
#RESDashboard .RESDashboardComponent {
/* 2 columns */
display: inline-block;
float: left;
margin: 0.6%;
vertical-align: top;
width: 48.5%;
}
#RESDashboardAddComponent {
@FiXato
FiXato / BattleArena-another_battle.log
Last active December 17, 2015 04:38
An example of a #BattleArena (low-level) autobattle.
20130512-04:01:58 #Ba <@BattleArena> A dimensional portal has been detected. The enemy force will arrive in 120 seconds. type !enter if you wish to join the battle!
20130512-04:02:01 #Ba <+FiXato> !enter
20130512-04:02:02 #Ba <@BattleArena> FiXato has entered the battle!
20130512-04:03:58 #Ba <@BattleArena> The weather changes. It is now windy
20130512-04:03:58 #Ba <@BattleArena> Metal Slime has entered the battle!
20130512-04:03:58 #Ba <@BattleArena> Metal Slime takes the same appearence of the Blue Slime, but is made out of metal instead!
20130512-04:03:58 #Ba <@BattleArena> Urahara Kisuke has entered the battle to help the forces of good!
20130512-04:03:59 #Ba <@BattleArena> Urahara Kisuke is a tall man with light blonde hair. He wears a dark green shirt and pants, along with a black coat, wooden clogs on his feet and a bucket hat with green and white stripes.
20130512-04:03:59 #Ba <@BattleArena> The monsters take the heroes by surprise and get to go first in battle!
20130512-04:03:59 #Ba <@BattleAren