Skip to content

Instantly share code, notes, and snippets.

View LeonBlade's full-sized avatar
🌙

James Stine LeonBlade

🌙
View GitHub Profile
@LeonBlade
LeonBlade / .htaccess
Created July 16, 2011 06:39
TinyChat Upload Redirection helps.
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^i/(.*) http://209.212.145.137/i/$1 [R,NC]
RewriteRule ^img http://something.com/ [R,NC]
@LeonBlade
LeonBlade / Game1.cs
Created August 23, 2011 11:13
Akitron's Fixes Editor 01
public Game1(Form1 parent, IntPtr drawSurface)
{
/* ... */
parent.pctSurface.MouseMove += new MouseEventHandler(pctSurface_MouseMove);
}
/* ... */
void pctSurface_MouseMove(object sender, MouseEventArgs e)
{
@LeonBlade
LeonBlade / map.cpp
Created August 23, 2011 11:22
Blade Brother's Map OnLoad
bool Map::OnLoad(const char* filename)
{
FILE* fileHandle = fopen(filename, "r");
if (fileHandle == NULL)
return false;
// read in the magic
fread(&magic, 4, 1, fileHandle);
if (magic != 1179468354)
@LeonBlade
LeonBlade / exterminate.sh
Created September 21, 2011 05:38
An easy way to send a terminate kill -15 to any proccess by name
#!/bin/bash
kill -15 $(ps -ax | grep -i $1 | grep -v exterminate | grep -v grep | perl -n -e '/([0-9]+)/ && print $1')
@LeonBlade
LeonBlade / imgur.sh
Created September 24, 2011 22:47
imgur uploader modified slightly for OS X use
#!/bin/bash
# imgur script by Bart Nagel <bart@tremby.net>
# 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
@LeonBlade
LeonBlade / compress.sh
Created October 11, 2011 12:00
Compresses Source Files of Whitespace
#!/bin/sh
for i in $@
do
cat $i | tr '\n' ' ' | sed 's/[[:blank:]]//g' > $i
done
@LeonBlade
LeonBlade / dabblet.css
Created January 16, 2012 02:33 — forked from andriynoble/dabblet.css
Register
/* Register */
* {
padding: 0;
margin: 0;
}
body {
background-color: whiteSmoke;
font-family: Tahoma;
}
div#betaregister {
@LeonBlade
LeonBlade / gist:1981421
Created March 5, 2012 21:55
PHP for getting browser info
<?php
// get browser data from useragent string for tracking
function _getBrowserInfo() {
// grab the useragent
$ua = $_SERVER['HTTP_USER_AGENT'];
// list of browsers we want to match
$browsers = array(
"firefox",
"msie",
// ==UserScript==
// @name FFXIV Subreddit Theme Fix
// @namespace http://github.com/LeonBlade
// @version 0.2
// @description Fix the FFXIV subreddit theme with annoying overflow elements
// @author James Stine (LeonBlade)
// @grant none
// @match /^https?://www\.reddit\.com\/r\/ffxiv$/
// @run-at document-end
// @include /^https?://www\.reddit\.com\/r\/ffxiv$/
// ==UserScript==
// @name FFXIV Hunts Path Finder Autocomplete
// @namespace http://github.com/LeonBlade
// @version 1.1
// @description Add a search box using datalist
// @author James Stine (LeonBlade)
// @grant none
// @match http://www.ffxivhuntspath.co.uk/
// @run-at document-end
// @include http://www.ffxivhuntspath.co.uk/