Skip to content

Instantly share code, notes, and snippets.

View aheadley's full-sized avatar

Alex Headley aheadley

View GitHub Profile
@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 / 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

#!/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 / lol2.php
Last active December 15, 2015 11:49
<?php
// PRIVATE
class A {
private $_a = 'foo';
public function get_a() {
return $this->_a;
}
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
#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);
}
@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
@aheadley
aheadley / words.txt
Created February 11, 2013 22:58
list of 4+ letter words in /usr/share/dict/words that are also found when rot13-encoded
orff
belk
nert
phat
tyrr
rool
roon
crex
cres
crea
#!/bin/bash
# The author of the original script is unknown to me. The first entry I can
# find was posted at 2010-03-21 09:50:09 on Arch Linux Forums (doesn't mean the
# poster is the author at all):
#
# https://bbs.archlinux.org/viewtopic.php?pid=728932#p728932
#
# I, Yu-Jie Lin, made a few changes and additions:
#
# -p, -R, and -C
Test (in-process): 46044 [ms]
Test (single thread): 44425 [ms]
Test (2 threads): 27837 [ms]
Test (4 threads): 49647 [ms]
Test (8 threads): 43913 [ms]
Test (16 threads): 56567 [ms]
Test (single proc): 49173 [ms]
Test (2 procs): 25880 [ms]
Test (4 procs): 13424 [ms]
Test (8 procs): 11163 [ms]