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
/* | |
ParseURL by James Padolsey: http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ | |
*/ | |
// This function creates a new anchor element and uses location | |
// properties (inherent) to get the desired URL data. Some String | |
// operations are used (to normalize results across browsers). | |
function parseURL(url) { | |
var a = document.createElement('a'); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Mini slider</title> | |
<link rel="stylesheet" href="mini-slider.css"> | |
</head> | |
<body> | |
<div id="slider"> | |
<!-- The previous button is inserted here --> |
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 obj = { | |
foo: 1, | |
bar: 2 | |
}; | |
Object.prototype.oops = function(){}; | |
// Meh. | |
for (var key in obj) { | |
if (obj.hasOwnProperty(key)) { |
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
// javascript:(function(){var%20w%20=%20window,h%20=%20w.location.host,p%20=%20w.location.pathname,r%20=%20p.match(/^(\/[^\/]+\/[^\/]+)/),gh%20=%20%27github.com%27,du%20=%20%27documentup.com%27;if%20(r%20&&%20h%20==%20gh)%20{w.location%20=%20%27http://%27%20+%20du%20+%20r[1];}%20else%20if%20(r%20&&%20h%20==%20du)%20{w.location%20=%20%27https://%27%20+%20gh%20+%20r[1];}})(); | |
(function(){ | |
var w = window, | |
h = w.location.host, | |
p = w.location.pathname, | |
r = p.match(/^(\/[^\/]+\/[^\/]+)/), | |
gh = 'github.com', | |
du = 'documentup.com'; | |
if (r && h == gh) { |
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 small script to display lightboxes. No IE6 support. */ | |
/*global jQuery: false*/ | |
(function($, window){ | |
"use strict"; | |
$.miniLightbox = {}; | |
var EVENT_NS = 'minilightbox'; | |
var DEFAULT_SETTINGS = { | |
'class': '', |
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
# | |
# css/js minification/compression makefile | |
# | |
# | |
# JS_TARGETS -- js files to minify/gzip | |
# CSS_TARGETS -- css files to minify/gzip | |
# CLEANUP -- additional files to delete during "make clean" | |
# |
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
// Use it with jQuery history: http://tkyk.github.com/jquery-history-plugin/ | |
// Hashes should begin with #!/ (see hash.slice(2) below) | |
(function($) { | |
$.history.initRoutes = function (routes) { | |
$(function() { | |
$.history.init(function(hash) { | |
hash = hash.slice(2); | |
var routeFound = false; | |
for (var rpath in routes) { | |
if (routes.hasOwnProperty(rpath)) { |
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 | |
// From Robbie Player: https://forrst.com/posts/Grab_Youtube_or_Vimeo_Info_with_PHP-0el#comment-150356 | |
function video_url_to_id($url, $provider) { | |
$video_id = FALSE; | |
$url = parse_url($url); | |
switch ($provider) { | |
case 'youtube': |
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
Error.prepareStackTrace = function(error, structuredStackTrace) { | |
console.log('ok.'); | |
}; | |
// Simple test, ok | |
try { | |
console.log('simple test\u2026'); | |
i_dont_exist(); | |
} catch(e) { | |
var access_stack = e.stack; |
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 webdeveloper_editCSSIntervalId = null; | |
var webdeveloper_editCSSOldStyleText = new Array(); | |
var webdeveloper_editCSSSelectedTab = 0; | |
var webdeveloper_editCSSUpdateFrequency = 500; | |
// Applies the CSS | |
function webdeveloper_applyCSS() | |
{ | |
var contentDocument = webdeveloper_getContentDocument(); | |
var headElement = webdeveloper_getDocumentHeadElement(contentDocument); |