Skip to content

Instantly share code, notes, and snippets.

View glamrock's full-sized avatar
🐝
hacking on things at Berkman <3

Griffin Boyce glamrock

🐝
hacking on things at Berkman <3
View GitHub Profile
@glamrock
glamrock / Jstor PDF renaming
Created August 22, 2011 02:36
Interesting script from @pmocek for renaming certain .PDFs
#!/bin/bash
# See discussion at <http://twitter.theinfo.org/95208900873302016>
# Search a directory for files with names ending in ".pdf".
# For each of those:
# If a file with similar name, ending in ".txt" instead of ".pdf" exists:
# If the text file contains a line beginning with "T1":
# Read the rest of the line to find a title
# Write the PDF's metadata to a temporary file
@glamrock
glamrock / Affinity99
Created February 28, 2012 07:58
John James's Affinity99.net script
'''
Affinity demo, Ver. 0.1. Open source, for Python3.1 using Bottle. 2012-02-14
Copyright 2011, 2012 by John S. James
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@glamrock
glamrock / gist:4370798
Created December 24, 2012 21:57
notbad.jpg
░░░░░░░░░▄██████████▄▄░░░░░░░░
░░░░░░▄█████████████████▄░░░░░
░░░░░██▀▀▀░▀▀▀▀▀▀▀████████░░░░
░░░░██░░░░░░░░░░░░░░███████░░░
░░░██░░░░░░░░░░░░░░░████████░░
░░░█▀░░░░░░░░░░░░░░░▀███████░░
░░░█▄▄██▄░░░▀█████▄░░▀██████░░
░░░█▀███▄▀░░░▄██▄▄█▀░░░█████▄░
░░░█░░▀▀█░░░░░▀▀░░░▀░░░██░░▀▄█
░░░█░░░█░░░▄░░░░░░░░░░░░░██░██
@glamrock
glamrock / gist:4370803
Created December 24, 2012 21:58
sparta
▓██████████▓░▒▒▒░░░░░░░░░░░░░▒█
▓██████████▓███████▒▒▒░░░▒▓██▒▓█▒
▒████████████▓▒▒▓████▓░▒███▓▓░▒█▓
▒██████████████▓▒▓███▓░▓██▓▓▓▓▒▓▓
▒█████████████▒░▒████▓░░▓▓░░░▒░▒▓
▒██████████▒░░░░▒▒██▓░░░░░░░░░░▓
▒███████████▓▒░░░▒▓▒▓░░░░░░░░░▒█
▒████████████▓░▒▓██▒▓▓▒░░▒▒░░░░▓
░▓███████████▓░▒███████▓▒▒█▓░░░░░
░▓███████████▒▒█████████████▓░░░▒
@glamrock
glamrock / gist:4620845
Created January 24, 2013 12:19
upvote all comments on imgur (and some other sites)
javascript:void($('.up').not('.pushed').click())
@glamrock
glamrock / gist:4974978
Created February 18, 2013 03:41
Shake.
javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct
@glamrock
glamrock / img iframe php notes
Last active December 16, 2015 08:49
based on old code & notes, still needs testing
It will show up as a broken image since the image effectively doesn't exist.
.htaccess
Redirect /embed.jpg http://somesite.com/embed.php
embed.php (possible - or some sort of redirection)
<?php header('Location: http://somesite.com/embed.html'); ?>
user's site
@glamrock
glamrock / gist:5722464
Created June 6, 2013 15:34
commotion removal
#!/bin/bash
# -*- Mode: sh; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Authors:
# Griffin Boyce
#
# Description:
# A simple Commotion removal script
#
# Legal Stuff:
@glamrock
glamrock / gist:5722469
Created June 6, 2013 15:34
commotion-linux-install
#!/bin/bash
# -*- Mode: sh; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Authors:
# Griffin Boyce
#
# Description:
# An installation script for Commotion Linux, customized for Ubuntu 12.04
#
# Legal Stuff:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
< :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: >
< :::::::::::: :::::::::::: :::::::::::: >
< ::::::::: :::: ::::::::: >
< ::::::: ******** :: ******** ::::::: >
< ::::: **** **** **** **** ::::: >
< :::: **** **** **** :::: >
< ::: **** ** **** ::: >
< ::: **** WHAT WHAT **** ::: >
< :::: **** ***** :::: >