Skip to content

Instantly share code, notes, and snippets.

View FiXato's full-sized avatar

Filip H.F. "FiXato" Slagter FiXato

View GitHub Profile
@FiXato
FiXato / weather_grabber.rb
Created March 16, 2010 18:37
Fetches weather info from Google Weather API and Weather Underground API.
#!/usr/bin/env ruby
# Fetches weather info from Google Weather API and Weather Underground API.
# Syntax:
# ./weather_grabber.rb [location]
#
# (c) 2010 Filip H.F. "FiXato" Slagter
# Licensed under Creative Commons Attribution-Share Alike 3.0 Unported License, http://creativecommons.org/licenses/by-sa/3.0/
['rubygems','nokogiri','open-uri','yaml', 'iconv'].each {|lib| require lib}
if ARGV.size > 0
location = ARGV.join(" ")
@FiXato
FiXato / moonblaster_recorder.tcl
Created March 27, 2010 00:57
openMSX script for recording video/audio of MoonBlaster tracks running via openMSX.
# TCL plugin script for openMSX Emulator
# Used to record MoonBlaster MBWave 1.16 tracks running through openMSX, in WAV and AVI.
# Version 0.9.5
#
# Changelog:
# 0.9.5 No need for global; variable will do;
# 0.9.4 Dual-licensed this script with GPL 2.0 for inclusion with openMSX;
# Bugfix: releasing the automatically pressed keys;
# Added: automatically stopping playback of song.
# 0.9.3 Updated documentation;
@FiXato
FiXato / vblank.tcl
Created July 14, 2010 17:51
TCL plugin script for openMSX Emulator to record a video of MSX software that makes use of switching frame rate frequencies.
# TCL plugin script for openMSX Emulator
# by Albert "BiFiMSX" Beevendorp and Filip H.F. "FiXato" Slagter
# Used to record a video of MSX software that makes use of switching frame rate frequencies.
# Version 0.7
#
# `toggle_vblank` enables/disables auto-'splitting' of videos at the frame rate change.
# `record_with_vblank` is a wrapper that enables the vblank detection, and allows for
# passing along `record start` parameters such as -prefix and -doublesize.
# It automatically starts the video recording and will stop and start recording a new video when
# the frame rate change is detected.
@FiXato
FiXato / iframe_builder.php
Created September 9, 2010 06:35
Simple function to return object or iframe code, based on HTTP_ACCEPT
<?php
if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {
header("Content-type: application/xhtml+xml");
}
else {
header("Content-type: text/html");
}
function iFrameBuild($id,$src)
{
@FiXato
FiXato / nzbmatrix_watchlist_mail2rss.rb
Created November 3, 2010 20:09 — forked from anonymous/nzbmatrix_watchlist_mail2rss.rb
Simple IMAP parser script that looks for NZBMatrix Watchlist mails and converts them to an RSS feed and downloads the NZBs.
#!/usr/bin/env ruby
# Simple IMAP parser script that looks for NZBMatrix Watchlist mails and converts them to an RSS feed and downloads the NZBs.
# Created by request of third party.
#
# LICENSE:
# Copyright 2010 Filip H.F. 'FiXato' Slagter
# You may use this work without restrictions, as long as this notice is included.
# The work is provided "as is" without warranty of any kind, neither express nor implied.
require 'net/imap'
require 'rss/maker'
@FiXato
FiXato / stopforumspam_parser.php
Created December 5, 2010 19:31
A very simple PoC parser for Chat4All to verify IPs against the stopforumspam database.
<?php
$input_file = "listed_ip_180.txt";
$ips = explode("\n",file_get_contents($input_file));
foreach(array("127.0.0.1","127.0.0.2") as $ip) {
echo "Checking if IP $ip occurs in file $input_file" . PHP_EOL;
if(in_array($ip,$ips)) {
echo "$ip occurs" . PHP_EOL;
} else {
echo "$ip not present" . PHP_EOL;
}
@FiXato
FiXato / flood.pm.diff
Created December 13, 2010 04:00
Diff file for IRC Defender's flood module. Adds exclusion channel support. Based on 1.40 bl.
1c1
< # $Id: flood.pm 861 2004-11-24 11:30:33Z brain/FiXato $
---
> # $Id: flood.pm 861 2004-11-24 11:30:33Z brain $
21,29d20
< my $excluded_channel;
< my $excluded;
< my @excluded_channels;
< my $total_excluded;
<
@FiXato
FiXato / parse_unreal_ips_conf.rb
Created December 15, 2010 01:59
A simple prototype script to parse the unrealircd ip.conf file.
#!/usr/bin/env ruby
#Simple mockup script for Chat4All to parse the UnrealIRCd ip.conf file which holds the 'ban ip'-blocks.
#LICENSE:
#Copyright 2010 Filip H.F. "FiXato" Slagter
#You may use this work without restrictions, as long as this notice is included.
#The work is provided "as is" without warranty of any kind, neither express nor implied.
# Get the lines from the Unreal ban ips.conf file. Strip leading and trailing whitespaces and repeated spaces.
# Compact so there are no empty lines / nil lines left in the array.
filepath = File.expand_path("~/script_resources/ips.conf")
@FiXato
FiXato / GPlusNicks.user.js
Created September 22, 2011 18:20
Proof of Concept UserJS script to add nicknames to Google+
// ==UserScript==
// @name G+ Nicks
// @namespace https://plus.google.com/
// @description Proof of concept script to add nicknames to usernames on G+
// @include https://plus.google.com/*
// ==/UserScript==
anchors = document.getElementsByClassName('yn');
function add_nickname(oid, username) {
@FiXato
FiXato / mrc_forum_userignore.user.js
Last active September 27, 2015 18:58
MRC Forum User Ignore user.js script
// ==UserScript==
// @name MRC Forum User Ignore(MRC)
// @namespace FiXato
// @description Hides messages from users you want to ignore on the msx.org forum
// @include http://www.msx.org/forum/*
// @version 1.1
// ==/UserScript==
//
// (c) 2011-2013, Filip H.F. "FiXato" Slagter, Licensed under MIT License.
// Tested with GreaseMonkey for Firefox 7 on Windows and on Chrome for Mac