Skip to content

Instantly share code, notes, and snippets.

@worr
worr / comment_hili.pl
Created January 2, 2011 05:56
Highlights comments in bold in an ncurses interface
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
use Curses;
# Use the name of this program if no file is passed in
my $filename = $ARGV[0] // "comment_hili.pl";
@worr
worr / badass_regexp.pl
Created January 8, 2011 09:05
(almost) matches well-formed XML
#!/usr/bin/perl
use strict;
use warnings;
use 5.012;
use Test::More tests => 18;
my @success = ("<content><test>testing</test><test>woo</test></content>",
@worr
worr / gist:989510
Created May 24, 2011 19:38
State vars in perl 5.8.8
#!/usr/bin/env perl
use strict;
use warnings;
use 5.008;
{
my $var;
sub state_sub {
@worr
worr / teh_spartan_fixer.pl
Created July 26, 2011 05:30
A quick POE bot that fixes spelling...poorly
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use Data::Dumper;
use POE qw/Component::IRC/;
use Search::Tools::SpellCheck;
@worr
worr / example1.pl
Created August 19, 2011 21:05 — forked from agargiulo/example1.pl
failing perl script section
use 5.010;
open(my $config, ">" "$configfile") or die $!;
$output = $row->{value};
my @output = split(/\n/, $output);
if ($wroteToFile)
{
foreach (@output)
{
@worr
worr / immutable.pl
Created October 15, 2011 22:44
How immutable is immutable?
#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
use Class::MOP;
my $tc_meta = Class::MOP::Class->initialize("TestClass");
$tc_meta->make_immutable(inline_constructor => 0);
@worr
worr / Net::AFP::DSI.pm
Last active October 2, 2015 17:48
Moose example
package Net::AFP::DSI;
use Const::Fast;
use Moose;
const our $REQ => 0x0;
const our $REPLY => 0x1;
const our $CLOSE => 0x1;
const our $CMD => 0x2;
@worr
worr / console.js
Created April 19, 2012 03:53
I made a console!
var jsconsole = (function() {
var prompt = ">";
var cursor = "_";
var text = "";
var cursor_displayed = true;
var history = [];
var history_cursor = -1;
var jsconsole_div;
var history_div;
@worr
worr / find_password_hash.py
Created June 6, 2012 19:59 — forked from jsundram/find_password_hash.py
Check if your password is in the linkedin password dump.
"""
Check if your password is in the linkedin password dump.
You'll need to download the dump from here: http://bit.ly/KGTusG and unzip it to combo_not.txt
"""
import hashlib
import getpass
pw = getpass.getpass('Enter your LinkedIn password: ')
sha1 = hashlib.sha1(pw).hexdigest()
@worr
worr / decrypt.c
Created July 2, 2012 02:19
Decrypts QQ packets (with libqq-pidgin)
#include <errno.h>
#include <glib.h>
#include <glib/gprintf.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "qq_crypt.h"
#define KEY_SIZE 1024