Skip to content

Instantly share code, notes, and snippets.

@dcat
dcat / userChrome.css
Created October 2, 2014 15:23
dcat's userChrome.css
/* hide all this shit */
.tab-close,
.tab-throbber,
.tab-icon-image,
.tab-close-button,
#newtab-scrollbox,
.tab-background-end,
.tabs-newtab-button,
.tab-background-start,
menuitem + menuseparator
@dcat
dcat / greentext.pl
Last active August 29, 2015 14:07
Irssi greentext.pl
#!/usr/bin/env perl -w
use vars qw($VERSION %IRSSI);
$VERSION = "1";
%IRSSI = (
authors => "dcat,kori",
name => "greentext.pl",
license => "beerware"
);
@dcat
dcat / greentext.pl
Last active August 29, 2015 14:07
WeeChat greentext.pl
#!/usr/bin/env perl -w
use strict;
use utf8;
sub greentext_cb {
my ($data, $mod, $mod_data, $msg) = @_;
if ($msg =~ /^>/) {
$msg="\x033" . $msg;
}
@dcat
dcat / echo.c
Created October 13, 2014 10:15
dcat's horrorcode
/* dcat's horrorcode, compile with; `cc -std=c99 -o echo echo.c` */
extern char write (unsigned, register const char *, unsigned);
static const char C[2] = { ' ', '\n' };
static mprint (char *x) {
register char *s,c;
for (s = x; *s; ++s);
c = write(1, &*x, s-x);
return ! c == s - x;
}
@dcat
dcat / gist:ebbbcc0088b13f0c2af0
Created October 13, 2014 17:45
IRC colour codes
IRC colour codes
0 = white
1 = black
2 = dark blue
3 = dark green
4 = red
5 = dark red
6 = dark magenta
7 = orange
@dcat
dcat / cursor-mask.xbm
Last active March 25, 2017 00:35
Aqua cursor port for X11
#define cursor_mask_width 11
#define cursor_mask_height 17
static unsigned char cursor_mask_bits[] = {
0x01, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x3f, 0x00,
0x7f, 0x00, 0xff, 0x00, 0xff, 0x01, 0xff, 0x03, 0xff, 0x07, 0x7f, 0x00,
0xf7, 0x00, 0xf3, 0x00, 0xe1, 0x01, 0xe0, 0x01, 0xc0, 0x00 };
@dcat
dcat / tile.xbm
Created October 30, 2014 15:02
tile.xbm
#define tile_width 56
#define tile_height 32
static unsigned char tile_bits[] = {
0x01, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x06, 0x40, 0x20, 0x10, 0x08,
0x04, 0xc0, 0x18, 0x40, 0x20, 0x10, 0x08, 0x04, 0x30, 0x60, 0x40, 0x20,
0x10, 0x08, 0x04, 0x0c, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0xe0,
0x43, 0x18, 0x10, 0x30, 0x84, 0x0f, 0x98, 0x4c, 0x06, 0x10, 0xc0, 0x64,
0x32, 0x86, 0xf0, 0x01, 0x10, 0x00, 0x1f, 0xc2, 0x81, 0x70, 0x00, 0x10,
0x00, 0x0c, 0x02, 0x81, 0x08, 0x00, 0x6c, 0x00, 0x18, 0x02, 0x81, 0x04,
0x00, 0x83, 0x01, 0x60, 0x02, 0x81, 0x03, 0xc0, 0x00, 0x06, 0x80, 0x03,
@dcat
dcat / quote.pl
Created January 30, 2015 02:34
quote.pl for weechat
#!/usr/bin/env perl -w
use strict;
use utf8;
sub quote_cb {
my ($data, $mod, $mod_data, $msg) = @_;
if ($msg =~ /^>/) {
$msg="\x03" . int(rand(15)) . $msg;
}
@dcat
dcat / xresource_test.c
Created June 2, 2015 00:01
Xresource example
/* $CC -o xresources_test xresources_test.c -lX11 */
#include <X11/Xresource.h>
#include <string.h>
#include <stdio.h>
#define XRESOURCE_LOAD_STRING(NAME, DST) \
XrmGetResource(db, NAME, "String", &type, &ret); \
if (ret.addr != NULL && !strncmp("String", type, 64)) \
DST = ret.addr;
@dcat
dcat / keybase.md
Created November 28, 2016 14:27
keybase.md

Keybase proof

I hereby claim:

  • I am dcat on github.
  • I am dcat (https://keybase.io/dcat) on keybase.
  • I have a public key whose fingerprint is 4DEC 416A 63E4 1987 E0A0 DC6A 870F 7216 87E4 9E93

To claim this, I am signing this object: