Skip to content

Instantly share code, notes, and snippets.

View JasonMillward's full-sized avatar
🐝
I may be slow to respond.

Jason JasonMillward

🐝
I may be slow to respond.
View GitHub Profile
@JasonMillward
JasonMillward / linkFollower.js
Created March 14, 2012 23:42
jQuery link follower (Simulates browsing through links on your website)
/**
* jQuery Link follower
*
*
* Used to simulate browsing a website.
* Can be used in conjunction with Tor to falsify hits and visitors.
*
* Place in header of template and view page in normal browser.
* Watch console for information
*
@JasonMillward
JasonMillward / latlong.pl
Created April 12, 2012 06:28
Perl - Latlong
#!/usr/bin/perl
### THINGS THAT GO AT THE TOP. NOTHING IMPORTANT
use Image::ExifTool qw(:Public);
use warnings;
use strict;
sub ConvertLatLong
{
my $var = shift(@_);
@JasonMillward
JasonMillward / coffeeButtons.coffee
Created April 14, 2012 07:04
CSS3+jQuery Buttons
$ = jQuery
###
formatBytes function
Takes in bytes as an int, does some maths
Spits out bytes converted to the proper ammount and suffix
###
formatBytes = (bytes) ->
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']
@JasonMillward
JasonMillward / git_svn_bash_prompt.sh
Created October 8, 2012 01:42 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to git/svn branch, and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the branch/status of the current git repository
# * the branch of the current subversion repository
# * the return value of the previous command
#
# USAGE:
@JasonMillward
JasonMillward / importer.sh
Created October 15, 2012 02:28
For cloning individual repos from Bitbucket into Github. Dirty, but it works.
#!/bin/bash
#
# Stupid script for importing Bitbucket changes into Github
# Because seriously, who uses Bitbucket when you have Github?
#
#
# Define the URLs and the paths and the things
GIT_CLONE_URL=""
BIT_CLONE_URL=""
@JasonMillward
JasonMillward / download.sh
Last active November 5, 2017 20:36
Download imgur.com galleries easily. This snippet downloads the latest 100 pages of images in the wallpaper gallery.
#!/bin/bash
for ((i = 0; i <= 100; i++)); do
echo "Grabbing page $i"
wget -q "http://imgur.com/r/wallpapers/page/$i" -O - | grep 'class="post"' | cut -d\" -f2 | while read id
do
echo "Downloading $id.jpg"
wget -q -c "http://i.imgur.com/$id.jpg"
done
###
jQuery Auto Capitalise + Capslock checker
Adds CSS to input classes, and optionaly checks for capslock and promts to turn off
Should prevent ALL CAPS data from appearing in database
Released under the MIT license
Copyright (c) 2013, Jason Millward
@version $Id: 1, 2013-09-04 $;
#!/bin/bash
txtred='\e[0;31m'
txtprp='\e[1;35m'
txtgrn='\e[0;32m'
txtrst='\e[0m'
find /mnt/kronos -type f | while read -r line; do
def hodor(hodor):
return {
0: "Hodor",
1: "Hodor Hodor"
}[hodor]
#!/bin/bash
find . -type f -iname "*.png" -print0 | while IFS= read -r -d $'\0' file; do
isWhite=`convert $file -colorspace HSL -channel g -separate +channel -format "%[fx:mean]" info:`
if [ "$isWhite" == "0" ]
then
rm $file
else