Skip to content

Instantly share code, notes, and snippets.

View JDRomano2's full-sized avatar

Joe Romano JDRomano2

View GitHub Profile
@JDRomano2
JDRomano2 / tech-tutorials.org
Last active May 25, 2021 15:18
Preferred instructional guides for installing and configuring various types of software
#!/bin/bash
## README:
# Dependencies: enscript, pstopdf
#
# Description: Simple shell script that prints a Javascript project to PDF, making it
# easier to print the project for review in hard copy.
# Base command:
# enscript --line-numbers -p - --word-wrap {FNAME} | pstopdf -i -o ~/out.pdf
@JDRomano2
JDRomano2 / gist:5647566
Created May 25, 2013 01:39
JavaScript: jQuery PubSub
(function($) {
var o = $( {} );
$.each({
on: 'subscribe',
trigger: 'publish',
off: 'unsubscribe'
}, function( key, api ) {
$[api] = function() {
o[key].apply( o, arguments );
@JDRomano2
JDRomano2 / gist:5647559
Created May 25, 2013 01:37
CSS: ImageReplacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@JDRomano2
JDRomano2 / gist:5647548
Created May 25, 2013 01:31
JavaScript: Sexy PubSub
// Works in modern browsers + IE9, but Modernizr has a polyfill baked in for function.bind.
// Hat tip Paul Irish
var o = $( {} );
$.subscribe = o.on.bind(o);
$.unsubscribe = o.off.bind(o);
$.publish = o.trigger.bind(o);
@JDRomano2
JDRomano2 / gist:5647537
Created May 25, 2013 01:27
HTML: Starting Template
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<script scr="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
</body>