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
// This: https://www.rabbitmq.com/tutorials/tutorial-one-go.html | |
// But without all the copied code between send and receive :) | |
package main | |
import ( | |
"os" | |
"log" | |
"strings" | |
"github.com/streadway/amqp" |
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 python3 | |
import shutil; | |
import collections; | |
import math; | |
import sys; | |
import argparse; | |
Point = collections.namedtuple('Point', ['x', 'y', 'n']) | |
HilbertAt = collections.namedtuple('HilbertAt', ['x', 'y', 'n']) |
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: |
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
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
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
#!/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
#!/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
``` | |
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
# 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 { |
NewerOlder