Skip to content

Instantly share code, notes, and snippets.

View PerpetualBeta's full-sized avatar

Jonathan M. Hollin PerpetualBeta

View GitHub Profile
@PerpetualBeta
PerpetualBeta / ticker.js
Created October 27, 2012 22:54
Compact, vertical, infinite ticker/scroller. Pauses on "mouseenter" event.
(function ($) {
$.fn.ticker = function (options) {
var defaults = {
speed: 1000,
pause: 3000,
p: false
};
options = $.extend(defaults, options);
@PerpetualBeta
PerpetualBeta / tinyImgCycle.js
Created October 27, 2012 10:49
Cycle through a series of images. Fade transition between slides. Loops back to first slide at end of collection.
// Requires the jQuery library - http://jquery.com/
// Demo: http://jsfiddle.net/DarkBlue/zM3A2/3/embedded/result/
function slideshow(){var a=$("#animation img.active");a.length==0&&(a=$("#animation img:last"));var b=a.next().length?a.next():$("#animation img:first");a.addClass("last-active");b.css({opacity:0}).addClass("active").animate({opacity:1},1E3,function(){a.removeClass("active last-active")})}$(function(){setInterval("slideshow()",5E3)});
@PerpetualBeta
PerpetualBeta / gist:3964029
Created October 27, 2012 10:23
Rename all files in a directory to their web-safe equivalents.
perl -e 'foreach $file (glob "*") { $dest_file = $file; $dest_file =~ s/ /_/sg; $dest_file =~ s/[^a-zA-Z_\-.0-9]//sg; rename $file, lc($dest_file) }'
@PerpetualBeta
PerpetualBeta / web-page-envelope.php
Created October 25, 2012 16:08
PHP wrapper for servers where mod_expires and/or mod_deflate are not available. Files routed through this wrapper will be served gzip-compressed, with an ETag and with a "far future expires" header.
<?php
/**
* Page delivery wrapper for servers where mod_expires and/or mod_deflate are
* not available.
*
* Route page requests through this wrapper (via mod_rewrite for example) and
* they will be served with far future expires, etags and will be gzip
* compressed.
*
@PerpetualBeta
PerpetualBeta / create_drop_all_dbs.sql
Last active August 29, 2015 14:18
A MySQL script that will generate a list of statements to drop all DBs on a server.
-- Run this script
SELECT CONCAT('DROP DATABASE `', schema_name, '`;') AS stmt
FROM information_schema.schemata
WHERE schema_name NOT IN ('information_schema', 'performance_schema', 'mysql')
ORDER BY SCHEMA_NAME;
-- Copy the output into your clipboard
SET FOREIGN_KEY_CHECKS = 0;
@PerpetualBeta
PerpetualBeta / keybase.md
Created September 17, 2014 21:35
Keybase.io Proof

Keybase proof

I hereby claim:

  • I am PerpetualBeta on github.
  • I am jhollin (https://keybase.io/jhollin) on keybase.
  • I have a public key whose fingerprint is 9547 E5D6 4590 94C5 D627 F8BC 1616 3E98 79D4 DF03

To claim this, I am signing this object: