Skip to content

Instantly share code, notes, and snippets.

View aheadley's full-sized avatar

Alex Headley aheadley

View GitHub Profile
@aheadley
aheadley / rs
Created February 12, 2013 23:16
$ retroshare-nogui -h
Help:
The commandline options are for retroshare-nogui, a headless server in a shell, or systems without QT.
-l [logfile] Set the logfilename
-w [password] Set the password
-i [ip_adress] Set IP Adress to use
-p [port] Set the Port to listen on
-c [basedir] Set the config basdir
-s Output to Stderr
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdint.h>
int small_rand() {
double d = drand48();
printf("Generated double: %f\n", d);
return (int)((uint64_t)d & 0xFFFF);
}
Loaded plugins: auto-update-debuginfo, fastestmirror
Loading mirror speeds from cached hostfile
* fedora: mirror.nexcess.net
* fedora-debuginfo: mirror.nexcess.net
* rpmfusion-free: mirror.nexcess.net
* rpmfusion-free-debuginfo: mirror.nexcess.net
* rpmfusion-free-updates: mirror.nexcess.net
* rpmfusion-free-updates-debuginfo: mirror.nexcess.net
* rpmfusion-nonfree: mirror.nexcess.net
* rpmfusion-nonfree-debuginfo: mirror.nexcess.net
@aheadley
aheadley / lol2.php
Last active December 15, 2015 11:49
<?php
// PRIVATE
class A {
private $_a = 'foo';
public function get_a() {
return $this->_a;
}
#!/bin/bash
# imgur script by Bart Nagel <[email protected]>
# version 2
# I release this as public domain. Do with it what you will.
# Required: curl
#
# Optional: xsel or xclip for automatically putting the URL on the X selection
# for easy pasting
@aheadley
aheadley / gist:7bce4311197fcb17c3a6
Last active March 21, 2016 16:13
[Suggestion] Fortifiable/Upgradable Bases

[Suggestion] Fortifiable/Upgradable Bases

Abstract (TL;DR): Bases are able to be upgraded by spending air/mech/infantry resources to reward factions for holding onto them. This increases game depth by encouraging strategy in a less artificial way, and encourages defensive play. It may also help resist zerg forces steamrolling bases and help personalize and differentiate bases, giving players a better feeling of "owning" a base. This may be done with a smaller development cost vs other entirely new features by leveraging existing effects as the base upgrades.

Preface: As things stand in the game currently, there isn't much of a reason to own a base beyond helping to take the next base. There is no real sense of "owning" a base, and all bases are sort of homogenized where it's either a small base, or a larger base, or a facility and as long as it's one of those types there's not really anything else to know about it. In an effort to increase the sense of ownership of a base, and increase the differences betw

@aheadley
aheadley / spam-clicks.sh
Created October 22, 2013 20:43
Spams the primary mouse click button for the given number of seconds, default is 75.
#!/bin/bash
RUNTIME=${1:-75}
start=$(date +%s)
while [ $(( $(date +%s) - $start )) -lt $RUNTIME ]; do
xdotool click --repeat 5 1
done
@aheadley
aheadley / output.txt
Created October 30, 2013 22:35
Example of how PHP's `protected` designation is stupid and broken.
$ php -f unprotector.php
$a->_x = you cant change me
$b->_x = you cant change me
set $b->_x = 'yes i can'
$a->_x = yes i can

Dear sir/ Madam,

So nice to contact you. We are manufacturer specialized in designing and producing innovative shoe dryer. Besides drying, our shoe dryer can effectively remove odor caused by bacteria and fungi which lead to dermatophytosis (athlete's foot), and it is good for hockey player.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Nexcess.net python-r1soft
# Copyright (C) 2013 Nexcess.net L.L.C.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.