Skip to content

Instantly share code, notes, and snippets.

@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);
}());
@nblenke
nblenke / server.js
Last active January 11, 2023 23:32
node react server
import express from 'express'
import * as path from 'path'
import cors from 'cors'
const app = express()
const PORT = process.env.PORT || 5000
const __dirname = path.resolve(path.dirname(''))
app.use(cors())
app.use(express.static(path.join(__dirname, 'public')))
@nblenke
nblenke / index.html
Created February 26, 2018 15:38
Header collapse on scroll(translate3d)
<style>
.spacer {
height: 2800px;
}
#test {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 80px;
@nblenke
nblenke / index.html
Created February 26, 2018 15:37
Header collapse on scroll(transition)
<style>
.spacer {
height: 2800px;
}
#test {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 80px;
<!doctype html>
<html>
<head>
<title></title>
<style>
.boom {
width:40px;
height:40px;
position:relative;
<!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 / 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>
@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 / 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');
}