Skip to content

Instantly share code, notes, and snippets.

View omgmog's full-sized avatar
⌨️

Max Glenister omgmog

⌨️
View GitHub Profile
@omgmog
omgmog / hack.sh
Last active December 12, 2015 10:48
Script to complete a 'hack' turn on hackcess.net using curl.
#!/bin/bash
USERNAME="yourusername"
PASSWORD="yourpass"
TARGET=$1
repeat() {
# repeat <n> <command>
n=$1
shift
@omgmog
omgmog / spotify-album-to-youfm.user.js
Created April 2, 2013 15:18
A userscript that turns `spotify:album:` links into `http://youfm.org` links
// ==UserScript==
// @name Spotify album links to youfm.org links
// @namespace http://omgmog.net
// @description Turns spotify:album: links into youfm.org links
// @include *
// @version 1.0
// ==/UserScript==
function get_anchors(){
var anchors = new Array();
@omgmog
omgmog / remove-blackberry.sh
Created May 29, 2013 18:32
This is all the useful bits from the Blackberry Desktop for Mac uninstaller. Run as root: $ sh remove-blackberry.sh
#!/bin/sh
if [ $UID -ne 0 ]; then
echo "Script must run as root"
exit 1
fi
/Library/Application\ Support/Blackberry/BBLaunchAgent.app -ndefault /Applications/BlackBerry\ Desktop\ Manager.app >> /dev/null
rm -fr "/Applications/BlackBerry Desktop Manager.app"
rm -fr "/Library/Receipts/blackberrydesktopmanager.pkg"
rm -fr /Users/*"/Library/Application Support/BlackBerryDesktop/"
rm -f /Users/*"/Library/Preferences/com.rim.blackberrydesktopmanager.plist"
@omgmog
omgmog / ievms
Created June 19, 2013 16:29
because I need these all in one file
https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE8_Win7/IE8.Win7.For.LinuxVirtualBox.part1.sfx
https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE8_Win7/IE8.Win7.For.LinuxVirtualBox.part2.rar
https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE8_Win7/IE8.Win7.For.LinuxVirtualBox.part3.rar
https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE8_Win7/IE8.Win7.For.LinuxVirtualBox.part4.rar
https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE8_Win7/IE8.Win7.For.LinuxVirtualBox.part5.rar
https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE8_Win7/IE8.Win7.For.LinuxVirtualBox.part6.rar
https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE9_Win7/IE9.Win7.For.LinuxVirtualBox.part1.sfx
https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE9_Win7/IE9.Win7.For.LinuxVirtualBox.part2.rar
https://az412801.vo.msecnd.net/vhd/IEKitV1_Final/VirtualBox/Linux/IE9_Win7/IE9.Win7.For.LinuxVirtualBox.part3.ra
@omgmog
omgmog / gist:6183203
Created August 8, 2013 09:37
Gracefully degrading stacked thumbnail effect in CSS
<div class="stackify">
<img src="http://placehold.it/200x200" />
</div>
@omgmog
omgmog / .htaccess
Created August 28, 2013 16:04
Redirect non-www to www with .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
@omgmog
omgmog / makeconf.sh
Created September 30, 2013 19:46
Bash function to create Apache site files magically.
function makeconf {
primary=${1}
conffile="${conf}/${primary}.conf"
echo "<VirtualHost *:80>" >> "${conffile}"
echo " Servername ${primary}" >> "${conffile}"
echo " ServerAlias www.${primary}" >> "${conffile}"
shift
for i; do
cat >> "${conffile}" <<EOL
ServerAlias ${i}
@omgmog
omgmog / server-commands.sh
Created October 25, 2013 14:48
Some commands I use on my Linode VPS to make life easier.
www=/srv/www
conf=/etc/apache2/sites-enabled
alias ra='/etc/init.d/apache2 restart'
alias ownit='chown -R www-data:www-data .'
function makeconf {
primary=${1}
conffile="${conf}/${primary}.conf"
site_path="/srv/www/${primary}"
mkdir -p ${site_path}
@omgmog
omgmog / parallax-scroll.js
Created October 28, 2013 15:26
Simple parallax background scrolling with jQuery
$(function() {
var $el = $('.parallax-background');
$(window).on('scroll', function () {
var scroll = $(document).scrollTop();
$el.css({
'background-position':'50% '+(-.4*scroll)+'px'
});
});
});
@omgmog
omgmog / gist:7338447
Last active December 27, 2015 14:09
Sublime prefs for work
{
"bold_folder_labels": true,
"color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme",
"fade_fold_buttons": false,
"fold_buttons": false,
"folder_exclude_patterns":
[
".git",
".bundle",
".sass-cache",