This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* tinyRouter.js | |
* | |
* Super simple JS router class, like super super simple | |
* doesn't use any regex to match url pathnames or hashes | |
* just takes a route name, looks for that function that matches it and runs it | |
* this is really only useful in small projects where you have a few pages and not a ton of JS | |
* but enough so where you still want to keep things organized | |
* | |
* there is one reserved route name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* mini templating library using native html5 templating | |
* important to note: since html5 templating is basically a wrapper over documentFragment you need to have content nested 1 level deep. | |
* You can't grab innerHTML of the documentFragment itself, but you can for its children. | |
* @param {string} id id attribute of the template tag | |
* @param {object} tmplData data to be added to the template | |
* | |
*/ | |
var html5tmpl = (function(id, tmplData) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- source http://apple.stackexchange.com/questions/98187/applescript-the-activate-command-makes-application-half-active | |
-- tested on Mavericks, needs a Security & Privacy -> Accessibility feature turned on. | |
tell application "System Events" to tell (process 1 where frontmost is true) | |
click (button 1 where subrole is "AXZoomButton") of window 1 | |
end tell | |
activate application (path to frontmost application as text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
sources: | |
http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/ | |
http://jsfiddle.net/necolas/rZvEF/ | |
*/ | |
/* ----- REUSABLE IMG BLOCK ----- */ | |
.imgblock { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source: https://gist.github.com/adunkman/2580972 | |
// background transparency | |
background-transparency(hexColor, alpha = 1) | |
ms-color = argb(hexColor, alpha) | |
background hexToRgb(hexColor) | |
background rgba(hexColor, alpha) | |
.mod-no-rgba & | |
*zoom 1 | |
background transparent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Extend Stylus to allow use of 6 digit hex color | |
* modified from this StackOverflow answer | |
* http://stackoverflow.com/a/9378924/395414 | |
*/ | |
module.exports = function() { | |
var hex = function(n) { | |
return n.toString(16) | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs"), | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname, | |
filename = path.join(process.cwd(), uri); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body{background-color:#96806B;color:black} | |
#siteTable > div{background-color:white;} | |
#siteTable{background-color:white;padding:10px;border-radius:10px;border:2px solid rgba(0,0,0,0.5);margin-top:10px;} | |
#header{background-color:#96806B;margin:10px;} | |
.side{background-color:white;border: 2px solid rgba(0,0,0,0.5);border-radius:10px;padding:10px;} | |
#sr-header-area{background-color:#96806B;} | |
#header-bottom-right{background-color:#96806B;color:black;margin-top:4px;} | |
#header{border:2px solid rgba(0,0,0,0.5);border-radius:10px;} | |
#RESShortcutsEditContainer{display:none} | |
.content{margin:10px;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A snippet I created to screen capture full webpages | |
* relies on html2canvas: http://html2canvas.hertzen.com/ | |
* and also requires local proxy for images embedded from other sites: https://github.com/niklasvh/html2canvas/wiki/Proxies | |
* | |
* In this gist I'm using the node.js version of the proxy: https://github.com/BugHerd/html2canvas-proxy-node | |
* | |
* Issues: | |
* | |
* For longer/larger pages I had an issue where the chrome tab would crash if I used PNG or JPEG, but WEBP seems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL); | |
ini_set('display_errors', 'on'); | |
class DbClass | |
{ | |
// MAMP default credentials for testing. These are not actually real creds that mean anything | |
private $db_url = 'localhost'; | |
private $db_login = 'root'; | |
private $db_pw = 'root'; |
OlderNewer