Skip to content

Instantly share code, notes, and snippets.

View jack126guy's full-sized avatar

Half-Gray jack126guy

View GitHub Profile
@jack126guy
jack126guy / maliksigi.pl
Last active August 29, 2015 14:03
Forigi iksojn el X-sistema Esperanto (Remove X's from X-system Esperanto)
#!/usr/bin/perl
#Tiu-ĉi programo estas en la publikaĵo (This program is in the public domain) http://creativecommons.org/publicdomain/zero/1.0/
#Legi tekston el norma enigo (Read text from standard input)
while(<STDIN>) {
#Anstataŭigi X-sistemajn vicojn (se ne estas alia X poste) [Replace X-system sequences (if there is not another X afterwards)]
s/c[xX]([^xX])/ĉ$1/g;
s/g[xX]([^xX])/ĝ$1/g;
s/h[xX]([^xX])/ĥ$1/g;
s/j[xX]([^xX])/ĵ$1/g;
@jack126guy
jack126guy / ccports.txt
Last active August 29, 2015 14:10
List of Creative Commons license ports, in a machine-readable format
;Creative Commons license ports
;Each jurisdiction is on a separate line. Data for each jurisdiction is presented in fields, separated by semicolons.
;The first field is the jurisdiction code (used in URLs and standard abbreviations), the second is the full name of the jurisdiction, and all subsequent fields are versions in which there was a port for that jurisdiction.
;If the first field is empty or contains only whitespace, then the line shall be considered a comment.
;Note that there were no unported 2.1 licenses.
;This list is derived from the Creative Commons Wiki <https://wiki.creativecommons.org/CC_Ports_by_Jurisdiction>, but it is believed that the data itself is uncopyrightable. This list is in the public domain <http://creativecommons.org/publicdomain/zero/1.0/>.
AR;Argentina;2.5
AU;Australia;3.0;2.5;2.1;2.0
AT;Austria;3.0;2.0
BE;Belgium;2.0
@jack126guy
jack126guy / fixdirs.pl
Last active August 29, 2015 14:11
Fix files created with Windows path names
#!/usr/bin/perl
#Instructions: On a Unix-like system, run: find [basedir] -type f | perl fixdirs.pl
#This script is in the public domain (http://creativecommons.org/publicdomain/zero/1.0/)
use strict;
use File::Path 'make_path';
use File::Copy 'copy';
my ($dn, $fn);
while(<STDIN>) {
chomp;
($dn, $fn) = m/(.*)\\([^\\]*)/;
@jack126guy
jack126guy / freelist.c
Last active August 29, 2015 14:19
"Free list" example
/*
* http://en.wikipedia.org/wiki/Free_list
* This code in the public domain under Creative Commons CC0 1.0 Universal Public Domain Dedication:
* http://creativecommons.org/publicdomain/zero/1.0/
*/
typedef struct free_list_node {
void* memory;
size_t size;
struct free_list_node* next;
@jack126guy
jack126guy / control
Created June 4, 2015 02:16
"linuxmasterrace" Debian package contents
Package: linuxmasterrace
Version: 1.2
Section: misc
Priority: optional
Architecture: all
Depends: xdg-utils, www-browser
Installed-Size: 1
Maintainer: Jack126Guy <someanon126@gmail.com>
Description: Open /r/linuxmasterrace on Reddit
This package contains a simple script to open the
@jack126guy
jack126guy / pgp-key-info.txt
Created June 29, 2015 21:03
PGP key details
Key ID: 0xBD956688FF815C0D
Fingerprint: 37AC 8245 20FA 0243 CF0E 8309 BD95 6688 FF81 5C0D
all: me a sandwich
me:
@printf 'You '
a:
@printf 'are '
sandwich:
@printf 'a sandwich\n'
@jack126guy
jack126guy / questioner.c
Last active August 29, 2015 14:27
Question-binary encoder ("questioner") and decoder ("questions")
/*
Question-binary encoder.
Reads data from standard input and outputs question-binary.
Available under the MIT License (below).
----------
The MIT License (MIT)
Copyright (c) 2015 Jack126Guy
@jack126guy
jack126guy / control
Created October 12, 2015 02:53
"dosoption" Debian package contents
Package: dosoption
Version: 1.1
Section: misc
Priority: optional
Architecture: all
Installed-Size: 2
Maintainer: Jack126Guy <someanon126@gmail.com>
Description: Execute programs using DOS-style options
This package contains a script that converts DOS-style
options into Unix-style options.
@jack126guy
jack126guy / cl
Created October 12, 2015 02:57
"microsoft-c++-express-2010" Debian package contents
#!/bin/sh
CONF_DIR='/etc/microsoft-c++-express-2010'
if [ -f "$CONF_DIR/cl-base" ]; then
#Trim whitespace
CC="`cat "$CONF_DIR/cl-base" | \
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
`"
else