This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// I have no idea how to solve the problem of the fact that anything | |
// declared here ends up on the global scope. Namespaces, maybe? But | |
// I'm doing this in part to get away from namespaces and just let things | |
// be functional. So I wrap it up in this load function but you should | |
// try to pick some name that won't conflict. | |
function fancyApi(&$exports) { | |
$myConfig = 'World'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 10 Status Code Definitions | |
Each Status-Code is described below, including a description of which method(s) it can follow and any shit required in the response. | |
## 10.1 Informational 1xx | |
This class of status code indicates a half-fucky response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. There are no required headers for this class of status code. Since HTTP/1.0 did not define any 1xx status codes, servers MUST wonder why exactly humans decided to start off at 200. | |
A client MUST be prepared to accept one or more half-fucky responses prior to a regular response, even if the client does not expect a 100 (Go On) status message. Unexpected 2xx status responses MAY be shit-canned by a user agent. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hello Class | |
This class exposes an interface "sayHello" that says hello. | |
If someone wrote a utility called 'gfmc', it would be a compiler that compiles whatever you put in code blocks in whatever language you specified and puts them in sensible places. | |
I don't think this is actually possible but you get the idea. It may not have any value at all, but then again it might if you want to make an API to your thing in every language anyone's ever heard of. | |
```php | |
class Hello { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
namespace My\Shitty; | |
use \Exception; | |
``` | |
# Class: Thing | |
It is a thing that holds stuff. Takes an array in the constructor in which to put stuff; doesn't care if it's empty or not. | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will return 0 if the specified file is older, 1 if newer than the specified date. | |
# Intended for use with GNU Find, like so: | |
# | |
# find filez/ -exec ./older.sh {} "2 days ago 00:00" + -delete | |
# | |
# If you want to find files that are newer than 2 days ago, you'd do something like: | |
# | |
# find filez/ -not -exec ./older.sh {} "2 days ago 00:00" + -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# This script will display a count of the arguments passed to it, | |
# once each time it is called by xargs. | |
# | |
# To show how xargs works: | |
# | |
# seq 1 1000000 | xargs ./count-args | |
echo Called once by xargs with $# arguments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ticklejw@MAL ~ | |
$ find test -exec ./sleepawhile {} \; -type f -print | |
Sleeping for 1 second... done! | |
Sleeping for 1 second... done! | |
test/0 | |
Sleeping for 1 second... done! | |
test/1 | |
Sleeping for 1 second... done! | |
test/2 | |
Sleeping for 1 second... done! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ip -o -4 addr | awk '/.* ([a-zA-Z0-9]+)/ {print $2 "\t" $4}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author Inscrutabilis / mailto:[email protected] | |
*/ | |
/* | |
* Generates a geodesic sphere geometry | |
* By default, it is 1x1x1 octahedron, as a first approximation to sphere | |
* It will return more sphere-like object if you specify iterations > 0 | |
* But please keep in mind that it generates (4 ^ iterations) * 8 faces | |
* Radius argument overrides default sphere radius (1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fftw3.h> | |
#include <math.h> | |
#define N 256 | |
// This thing does a fourier transform on a generated array of data | |
// and makes a CSV out of it so I could make pretty graphs in an | |
// outside tool. | |
// | |
// in the output: |
OlderNewer