Skip to content

Instantly share code, notes, and snippets.

View appastair's full-sized avatar
😷

Alastair Gifillan appastair

😷
View GitHub Profile
@appastair
appastair / thumbnails.less
Created June 6, 2013 17:20
Twitter Bootstrap Responsive Thumbnails (2.3.2)
//
// Thumbnails
// --------------------------------------------------
// Note: `.thumbnails` and `.thumbnails > li` are overriden in responsive files
// Make wrapper ul behave like the grid
.thumbnails {
margin-left: -@gridGutterWidth;
@appastair
appastair / mobile-numbers.php
Created April 6, 2013 17:23
Generate Australian Phone Number Lists
<?php
/* Number Prefix Source: http://en.wikipedia.org/wiki/Telephone_numbers_in_Australia#Mobile_phone_numbers_.2804.29 */
$mobile_prefixes = array('0400', '0401', '0402', '0403', '0404', '0405', '0406', '0407', '0408', '0409', '0410', '0411', '0412', '0413', '0414', '0415', '0416', '0417', '0418', '0419', '0420', '0421', '0422', '0423', '0424', '0425', '0427', '0428', '0429', '0430', '0431', '0432', '0433', '0434', '0435', '0437', '0438', '0439', '0440', '0446', '0447', '0448', '0449', '0488', '0450', '0451');
foreach($mobile_prefixes as $mobile_prefix){
for($number = 0; strlen($number) < 7; ++$number){
echo $mobile_prefix.str_pad($number, 6, '0', STR_PAD_LEFT)."\n";
}
}
?>
@appastair
appastair / crontab.sh
Created April 6, 2013 16:26
Automated Torrents with Bash, RTorrent and RSS Torrent Feeds
@hourly "sh ~/torrent-feeds.sh" # add this line by editing your cron jobs ("crontab -e")
@appastair
appastair / status.sh
Created February 26, 2013 02:47
Bash HTTP Status
xargs curl -sw "%{url_effective},%{http_code},%{redirect_url}\\n" < urls.lst > urls.csv
@appastair
appastair / bambuser.py
Last active March 20, 2023 12:07
Bambuser.com Video Downloader
from optparse import OptionParser
parser = OptionParser()
parser.set_defaults(verbose=True)
parser.add_option('-v','--video-id',dest='video')
(options, args) = parser.parse_args()
if options.video is None:
exit("-v, --video-id=NUM Bambuser.com Video ID i.e. http://bambuser.com/v/5029")
import urllib
@appastair
appastair / crontab
Last active April 12, 2019 22:29
mysqldump diff
@midnight "sh /home/user/mysqldiff-backup.sh"
@appastair
appastair / youtube-dl.sh
Created November 23, 2012 10:00
YouTube Batch Video Downloader Script
#!bin/bash
# Requires: youtube-dl (apt-get install)
# Usage: youtube-dl.sh < video-links.lst
while read line
do
youtube-dl $line --max-quality -t --write-info-json
done
@appastair
appastair / metasploit-latest-x64.sh
Created October 18, 2012 17:51
Metasploit for Ubuntu 12.04
wget http://downloads.metasploit.com/data/releases/metasploit-latest-linux-x64-installer.run
chmod +x metasploit-latest-linux-x64-installer.run
sudo ./metasploit-latest-linux-x64-installer.run
@appastair
appastair / jsonp.js
Last active August 23, 2020 17:52
Cross-domain JSONP Example (jQuery/PHP)
jQuery(function($){
$.ajax({
type: 'GET',
url: '//remote.org/jsonp.php',
data: {
field: 'value'
},
dataType: 'jsonp'
crossDomain: true,
}).done(function(response){