Skip to content

Instantly share code, notes, and snippets.

@louipc
louipc / wikidump.c
Last active September 16, 2018 04:12
#include <stdio.h>
int main() {
const float nums[] = {15200.0, 195.6, 320.6, 310.5, 349.7, 318.7, 312.2, 316.9, 315.0, 363.6, 388.4, 318.3, 298.7, 313.6, 314.9, 323.1, 351.2, 314.0, 283.0, 336.3, 342.8, 268.0, 276.4, 436.7, 286.3, 264.7, 294.1, 277.1, 269.8, 280.1, 271.3, 297.7, 282.3, 262.5, 335.3, 266.2, 145.8, 248.1, 235.1, 259.7, 213.7, 203.3, 219.7, 221.1, 263.4, 261.8, 240.4, 268.8, 255.4, 259.3, 246.9, 245.3, 255.8, 306.7, 263.2, 4.5, 268.4, 244.2, 239.1, 234.5, 233.4, 248.0, 247.4, 228.7, 246.6, 238.6, 280.2, 239.8, 283.9, 243.9, 247.4, 239.6, 227.9, 252.9, 259.3, 263.4, 246.1, 240.6, 252.5, 243.6, 256.1, 297.5, 278.9, 255.9, 233.3, 236.4, 244.5, 238.5, 232.3, 235.5, 234.5, 361.1, 6.4, 291.3, 233.9, 267.9, 229.8, 256.1, 246.6, 224.6, 236.7, 235.7, 211.3, 242.6, 257.4, 225.3, 228.0, 228.4, 239.9, 221.5, 229.3, 13.6, 233.6, 227.2, 223.0, 229.3, 453.2, 384.3, 241.1, 225.9, 228.4, 224.4, 239.7, 243.5, 227.0, 227.8, 230.6, 237.0, 232.3, 236.4, 10.0, 235.4, 234.7, 226.5, 220.6, 221.1, 227.6, 229.6, 305
On a hot summer afternoon in New York City, June and I walked
through the zoo in Central Park. It was a hot dog and ice cream
day. The place was crowded and giving up on the hassle of
working our way through the crowd we headed back to the hotel
to get ready for the concert that night at Garden State Art Center.
As we appraoched the hotel, I saw a bum lying on the sidewalk in
front of the hotel. He never even opend his eyes when I stood
over him. June said, “Come on, oney, let's go.” But I said, “Just a
minute.” I walked around him hoping he wasn't dead. My shadow
fell across him and when I moved on, I saw his eyes flutter as the
set -eu
tmp=`mktemp`
langfile=~/doc/lists/langs-iso639-2-short
mkvextract tags "$1" >| "$1.xml"
echo "<!-- languages: http://www.loc.gov/standards/iso639-2/php/English_list.php" >> "$1.xml"
echo " langfile: $langfile" >> "$1.xml"
cat "$langfile" >> "$1.xml"
echo " -->" >> "$1.xml"
<?php
# A simple web uploader
# Copyright (C) 2009 by Loui Chang <louipc.ist@gmail.com>
#
# Where the file is going to be placed
$target_path = "files/";
set_time_limit(0);
date_default_timezone_set('UTC');
@louipc
louipc / noise.sh
Last active October 10, 2017 03:49
#!/bin/sh
# inspired by idunnowhat
# louipc base64:bG91aXBjLmlzdEBnbWFpbC5jb20=
#
max=10
interval=.5
pause=3
i=1
while [ $i -le $max ];
@louipc
louipc / colors.c
Last active November 19, 2021 11:50
/* ported to C by louipc base64:TG91aSBDaGFuZyA8bG91aXBjLmlzdEBnbWFpbC5jb20+
* from 256colors2.pl by Todd Larason <jtl@molehill.org>
*
* cuz fuck perl
*
* use the resources for colors 0-15 - usually more-or-less a
* reproduction of the standard ANSI colors, but possibly more
* pleasing shades
*
* Build with:
#!/bin/bash
set -o noclobber
domain="${1:-`whoami`}"
# NOCSR
# mkdir /etc/nginx/ssl
# cd /etc/nginx/ssl
# openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt -days 1095
#include <stdio.h>
#include <stdint.h>
int main() {
for (uint8_t i = 9; i >= 0; i--) {
printf("%d\n", i);
}
return 0;
}
/**
* fntools (https://github.com/louipc/fntools) are a fork and port to C of
* FNG Canada Social Insurance Number Generator and Validator v1.1
* Copyright © 2009 Fake Name Generator <http://www.fakenamegenerator.com/>
* available at
* https://github.com/corbanworks/fng-sin-tools
* http://www.fakenamegenerator.com/social-insurance-number.php
*
* fntools port is Copyright © 2016 Loui Chang, etc
*
@louipc
louipc / nfocat.sh
Last active October 10, 2017 03:59
nfocat.sh
#!/bin/sh
# nfocat.sh
# Convert CP437 (.nfo) files to utf8 unix format
# Also add a trailing newline
for file in "$@"; do
echo $file
iconv -f cp437 -t utf8 "$file" | tr -d '\r'
echo
done