Skip to content

Instantly share code, notes, and snippets.

View icedraco's full-sized avatar
🐲
Rawr

Artex icedraco

🐲
Rawr
View GitHub Profile
@icedraco
icedraco / Makefile
Created November 27, 2014 11:37
Makefile nesting example
EXEC=test
all:
cd src; make
mv src/$(EXEC) ./
clean:
rm -f src/*.o $(EXEC)
@icedraco
icedraco / aferdowsi-sudoku-solver.py
Created November 27, 2014 11:40
AFERDOWSI sudoku puzzle solver for the first Dropbox challenge that I wrote. Beats solving it the long way... :D
sTable = [
[' ', 'W', 'I', ' ', ' ', 'D', ' ', ' ', 'A'],
['D', ' ', 'F', ' ', 'W', ' ', ' ', 'O', ' '],
['R', 'S', ' ', ' ', ' ', ' ', ' ', ' ', ' '],
[' ', ' ', 'D', 'F', ' ', 'A', ' ', ' ', 'O'],
[' ', 'A', 'O', ' ', ' ', ' ', 'D', 'R', ' '],
['S', ' ', ' ', 'E', ' ', 'O', 'A', ' ', ' '],
[' ', ' ', ' ', ' ', ' ', ' ', ' ', 'A', 'W'],
[' ', 'F', ' ', ' ', 'A', ' ', 'O', ' ', 'I'],
['A', ' ', ' ', 'W', ' ', ' ', 'R', 'F', ' ']
@icedraco
icedraco / sample-tokenizer.py
Created November 27, 2014 11:42
Sample tokenizer script for a university assignment
#!/usr/bin/python
###--# Sample Tokenizer Script for Assignment4 (BGU)
# Author: IceDragon <icedragon@quickfox.org>
# Contact: http://www.icerealm.org/contact
#
# Define a function that returns a list of tokens (i.e.: ['a', '=', '3', ...])
def tokenize(filename):
# Open file and read all the data into the memory.
@icedraco
icedraco / gist:0d0c006ce6aa07ef5b2d
Created November 27, 2014 11:44
A word scrambler script that keeps the first and the last letter in each word intact, and shuffles the letters in the middle. A person can often read the scrambled words just fine without realizing it.
from sys import argv
from random import shuffle
def scrambleWord(w):
i = len(w) - 1
# If it's a zero-length string, return it right away.
if i < 0:
return w
else:
# Handle non-alphabetical characters after the word/
@icedraco
icedraco / word-scrambler.py
Last active August 29, 2015 14:10
A word scrambler script that keeps the first and the last letter in each word intact, and shuffles the letters in the middle. A person can often read the scrambled words just fine without realizing it.
from sys import argv
from random import shuffle
def scrambleWord(w):
i = len(w) - 1
# If it's a zero-length string, return it right away.
if i < 0:
return w
else:
# Handle non-alphabetical characters after the word/
@icedraco
icedraco / vcard-import.py
Created November 27, 2014 11:46
A script that imports a lot of UTF-8-encoded VCF files into a single list for use with programs like Excel
# Import a [large] group of UTF-8-encoded VCF files into a single
# "<name>\t<phone>\r\n" text file for use with Excel or other programs.
#
# Requires: vobject (which requires dateutil)
#
# Author: IceDragon <icedragon@quickfox.org>
# http://www.icerealm.org/contact
import vobject
from glob import glob
@icedraco
icedraco / furc-puzzle.py
Created November 27, 2014 11:48
A rather naiive puzzle solver for a Furcadia puzzle map, where each tile you step on disappears. One has to walk through each tile before stepping on the final one.
#!/usr/bin/python
# Syntax: python puzzle.py datafile.txt
#
# SAMPLE DATA FILE CONTENTS:
#
# yR#r####
# # # #
# rS#Y#E R
# # # #
@icedraco
icedraco / heimtest.py
Created November 27, 2014 11:50
An old heimdall/server connectivity tester that ensures that all the internal servers are reachable and inter-connected by probing/polling them with multiple login attempts.
# .-=[ heimtest.py ]========================================================-. #
# | Furcadia Heimdall Testing Script (c) 2007 by IceDragon of QuickFox.org | #
# |--------------------------------------------------------------------------| #
# | This script has the capability to automatically check for the status of | #
# | Furcadia heimdalls and report back which one is linked to a horton and | #
# | which ones are solo and may need to be reconnected. This provides for an | #
# | automatic solution for an otherwise rather tedious work. | #
# | Requirements: | #
# | - Extended `which capability provided to Lvel100+ bugge hunters! | #
# |--[ Changelog ]-----------------------------------------------------------| #
@icedraco
icedraco / Base220.cs
Created November 27, 2014 11:52
Furcadia number conversion classes I wrote for C# back in 2010
using System;
using System.Text;
namespace Furcadia
{
public class Base220 : IComparable<uint>, IEquatable<uint>
{
public const byte CHAR_OFFSET = (byte)'#';
public const byte BASE = 220;
public uint Value;
@icedraco
icedraco / mysqldump.c
Created November 27, 2014 11:56
A small program I wrote to update IRC services databases to MySQL on demand from outside the network
/* Routines to handle `mysqldump' invocations.
*
* (C) 2009 QuickFox.org
*
*/
#include "services.h"
/*************************************************************************/