Skip to content

Instantly share code, notes, and snippets.

View ward's full-sized avatar

Ward Muylaert ward

View GitHub Profile
# Counts lines from all files in this directory and below it
# Ignores hidden files (to make it include hidden files, change
# the * wildcard to a .
line_ctr=0; for file in `find * -type f`; do echo $file `cat $file | wc -l`; line_ctr=$line_ctr+`cat $file | wc -l`; done; echo $((line_ctr))
@ward
ward / cursify
Created September 29, 2011 19:48
[Not mine] Takes ASCII from stdin, shows it in fancy mathematical symbols
#!/usr/bin/env python
# vim: set fileencoding=UTF-8 :
#
# Copyright (c) 2010, Jonas Häggqvist <rasher@rasher.dk>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
Detail top: H 0 - S 7 - L 41
Background top: H 0 - S 0 - L 0
Detail bottom: H 0 - S 7 - L 41
Background bottom: H 12 - S 7 - L 83
@ward
ward / google-plus-one-bookmarklet.js
Created November 26, 2011 21:01
Google +1 Bookmarklet
(function() {
var a,b;
a=document.createElement('script');
a.type='text/javascript';
a.async=true;
a.src='https://apis.google.com/js/plusone.js';
b=document.createElement('div');
b.id='ward_plusone';
b.style.position='fixed';
b.style.top='10px';
@ward
ward / gist:1636203
Created January 18, 2012 22:23
Old mIRC input mode script
; Allows setting modes by simply typing "+MODE" or "-MODE"
on *:INPUT:#:{
if (!$inpaste && !$ctrlenter && $regex($1,/^[+-][qaohv\Q $+ $remove($chanmodes,$chr(44)) $+ \E]/)) {
haltdef
mode $chan $$1-
}
}
@ward
ward / gist:1636461
Created January 18, 2012 23:18
SwiftIRC Unreal - strip reverse
--- m_message.c.old 2012-01-19 00:17:45.142995611 +0100
+++ m_message.c 2012-01-19 00:17:58.849662027 +0100
@@ -1350,7 +1350,7 @@
rgb = 1;
nc = 0;
}
- else
+ else if (*text != '\026') /* (strip reverse too) */
{
new_str[i] = *text;
@ward
ward / gist:1636568
Created January 18, 2012 23:43
SwiftIRC Unreal - block reverse
--- channel.c.old 2012-01-19 00:42:31.859634901 +0100
+++ channel.c 2012-01-19 00:42:52.066301195 +0100
@@ -796,7 +796,7 @@
char *c;
for (c = msgtext; *c; c++)
{
- if (*c == 3 || *c == 27 || *c == 4)
+ if (*c == 3 || *c == 27 || *c == 4 || *c == 22)
return (CANNOT_SEND_NOCOLOR);
}
@ward
ward / challenges.xml
Created April 24, 2012 17:44
STK - after player ID rewrite
<?xml version="1.0"?>
<challenges>
<gameslot playerID="4f96e52e163bbd2e" kart="" firstTime="false">
<city>
<easy solved="false"/>
<medium solved="false"/>
<hard solved="false"/>
</city>
<farm>
<easy solved="true"/>
@ward
ward / main.md
Created June 26, 2013 09:11
Odd audio snippet
@ward
ward / gist:8742475
Last active October 21, 2015 21:08
Dump rtsp into mp4 file
ffmpeg -i rtsp://yourlinkhere -acodec copy -vcodec copy FILENAME.mp4