Skip to content

Instantly share code, notes, and snippets.

@nblenke
nblenke / Google Map v3 from Saxotech geodata
Created March 21, 2012 17:40
Google Map v3 from Saxotech geodata
<!DOCTYPE html>
<html lang="en">
<head>
<!-- ***********************************
* Method:
* Purpose: called from article7.pbo, displays google map via saxo geodata fields,
* this map is opened via saxo template (?template=geo)
*
* 20110510 NB
* 20110627 NB - Updated to allow for multiple markers
@nblenke
nblenke / PlusEmbed
Last active October 2, 2015 02:08
A jQuery plugin to scrape your Google +1s page with YQL,jQuery
(function($) {
'use strict';
$.fn.PlusEmbed = function(stg) {
var $this = this,
cfg = {
count: 10
};
if (stg) {
$.extend(cfg, stg);
@nblenke
nblenke / Slide Menu
Last active December 17, 2015 20:59
A menu experiment
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test</title>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<style type="text/css">
h1 {font:normal 23px/1.5 Georgia, times;}
a{color: #555;}
@nblenke
nblenke / Stagify
Last active December 24, 2015 12:29
Create a staging environment
var stagify = function () {
if (window.location.search.search('staging=true') !== -1) {
$('html')
.addClass('staging')
.find('a').each(function () {
var h = $(this).attr('href'),
q = !!h && h.search(/\?/) !== -1 ? '&': '?';
if (!!h && h.search('#') === -1) {
$(this).attr('href', h + q + 'staging=true');
}
@nblenke
nblenke / Backbone Single Page
Last active December 24, 2015 12:29
A one page Backbone starter application template
<!DOCTYPE html>
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<head>
<title>Backbone</title>
</head>
<body>
<header></header>
@nblenke
nblenke / Angular Single Page
Created November 15, 2013 15:00
A one page Angular starter application template
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<head>
<title>Angular</title>
</head>
<body>
<a href="#!/">Home</a> | <a href="#!/test">Test</a>
<div ng-view></div>
<!DOCTYPE html>
<html>
<head>
<title>Calendar Puzzle</title>
<style>
.mark {border-top:1px solid red;width:400px;height:30px;}
.time {float:left}
.event {left:100px;position:absolute;opacity:.4;color:#fff}
.event {background:red;width:302px;}
/*.event + .event {background:green;width:150px;left:252px;}*/
@nblenke
nblenke / Google Image Resize Proxy
Created January 28, 2014 14:30
Use Google's Image caching/optimization proxy to resize an image
(function () {
var img = document.createElement('img');
path = encodeURIComponent('https://s3.amazonaws.com/llama0/burningfiremonkey.gif'),
width = 600,
refresh = 2592000;
img.src = 'https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url=' + path + '&resize_w=' + width + '&container=focus&refresh=' + refresh;
document.body.appendChild(img);
}());
function RgbToHsv(r, g, b) {
var min = Math.min(r, g, b),
max = Math.max(r, g, b),
delta = max - min,
h, s, v = max;
v = Math.floor(max / 255 * 100);
if (max == 0) return {h: 0, s: 0, v: 0};
s = Math.floor(delta / max * 100);
var deltadiv = delta == 0 ? 1 : delta;
<!DOCTYPE html>
<html lang="en">
<head>
<title>Template Example</title>
<meta charset="utf-8">
</head>
<body>
<section id="placeholder0"></section>
<section id="placeholder1"></section>