Skip to content

Instantly share code, notes, and snippets.

View omgmog's full-sized avatar
⌨️

Max Glenister omgmog

⌨️
View GitHub Profile
@omgmog
omgmog / news.layervault.com.css
Created March 3, 2015 11:51
Userstyle to make DN better, works nicely with Stylish for Chrome!
/* Hide the 'Jobs' stuff */
#MOTD,
#NavigationLinks .Jobs,
.JobContent {
display: none;
}
/* Increase the item numbers */
.Frontpage .InnerPage ol li:before, .Newest .InnerPage ol li:before, .Sponsored .InnerPage ol li:before, .Search .InnerPage ol li:before, .Notifications .InnerPage ol li:before, .Discussions .InnerPage ol li:before {
font-size: 20px;
line-height: 20px;
if [ "$(uname -s)" == "Darwin" ]; then
# Mac stuff
else
# Linux stuff
fi
@omgmog
omgmog / murder.sh
Last active August 29, 2015 14:17
For killing tasks
function murder {
ps ax | grep "${*}" | grep -v grep | awk "{print \$1}" | xargs sudo kill -9
}
@omgmog
omgmog / gist:3111ccea3456018b192f
Created April 13, 2015 19:12
elementary os freya repos
deb http://ppa.launchpad.net/elementary-os/stable/ubuntu trusty main
deb-src http://ppa.launchpad.net/elementary-os/stable/ubuntu trusty main
deb http://ppa.launchpad.net/elementary-os/os-patches/ubuntu trusty main
deb-src http://ppa.launchpad.net/elementary-os/os-patches/ubuntu trusty main
@omgmog
omgmog / gist:fcf138f292efe0057786
Created April 17, 2015 10:26
CSS Specificity
* {} -> specificity = 0,0,0,0
p {} -> specificity = 0,0,0,1
p:first-child {} -> specificity = 0,0,0,2
p span {} -> specificity = 0,0,0,2
p span+i {} -> specificity = 0,0,0,3
p span i.red {} -> specificity = 0,0,1,3
p.red.active {} -> specificity = 0,0,2,1
#name {} -> specificity = 0,1,0,0
style="" -> specificity = 1,0,0,0
@omgmog
omgmog / cronjob.sh
Created July 12, 2015 09:49
Relaunch Spotify
# Then simply set up a cron job
$ nano ~/crontab
# Paste the following
1 0 * * * osascript ~/Desktop/relaunchSpotify.applescript
@omgmog
omgmog / server.js
Created July 12, 2015 15:35
socket.io signalling server
/*jslint node: true */
(function (){
'use strict';
var nodeStatic = require('node-static');
var http = require('http');
var io = require('socket.io')();
var server = new(nodeStatic.Server)();
var app = http.createServer(function (request, response) {
@omgmog
omgmog / conditionallyChangeFont.js
Last active August 29, 2015 14:25
Conditionally change fonts in a page
// Here you specify the fonts that you don't want to change, so as not to conflict with icon fonts, etc.
var excludedFonts = ["FontAwesome", "Icomoon", "Fontelico", "octicons", "Entypo", "Typicons"];
// Here you specify your new font for everything else
var newFont = "ComicSansMS, Arial";
// Wrap the changer as a function
var conditionallyChangeFont = function () {
// Here be dragons. Lots of DOM traversal
curl https://api.github.com/repos/AverageMarcus/Test/issues -X POST -H 'Authorization: token <NO TOKEN FOR YOU>' -d '{"title":"Testing via CURL","body":"Using an OAuth key, will it work?"}'
@omgmog
omgmog / .sh
Created July 31, 2015 09:58
Launch multiple instances of Xcode iOS Simulator
# If you've already got an instance of a device open, it will warn
# you and you'll have to switch to a different model/OS version.
#
# From a terminal window:
open -n /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app