Skip to content

Instantly share code, notes, and snippets.

@kujon
kujon / placeholder.js
Created March 7, 2012 23:45 — forked from athanassiadis/Modernizr placeholder
JavaScript: Modernizr placeholder
if (!Modernizr.input.placeholder) {
$('[placeholder]').each(function() {
var $self = $(this);
$self.val($self.attr('placeholder'));
$self.focus(function() {
$self.val('');
}).blur(function() {
if($self.val().length < 1) {
@kujon
kujon / modernizr-tests.js
Created March 8, 2012 00:04 — forked from danott/modernizr-tests.js
JavaScript: Custom Modernizr tests that are useful.
/* modernizr-test.js
* Daniel Ott
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/
@kujon
kujon / modernizr.css
Created March 8, 2012 00:06 — forked from qwertypants/modernizr.css
CSS: Generic structure for Modernizr CSS styles
.js {}
.no-js {}
.flexbox {}
.no-flexbox {}
.canvas {}
.no-canvas {}
.canvastext {}
.no-canvastext {}
.webgl {}
.no-webgl {}
@kujon
kujon / rAF.js
Created March 15, 2012 14:21 — forked from paulirish/rAF.js
JavaScript: requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@kujon
kujon / Asset.css
Created March 15, 2012 14:30 — forked from jCrip/Asset.css
CSS: Media Queries Bootstrap
// Landscape phones and down
@media (max-width: 480px) { ... }
// Landscape phone to portrait tablet
@media (max-width: 767px) { ... }
// Portrait tablet to landscape and desktop
@media (min-width: 768px) and (max-width: 979px) { ... }
// Large desktop
@kujon
kujon / Asset.js
Created March 15, 2012 15:23 — forked from jCrip/Asset.html
JavaScript: Viewport Scaling Bug
(function(doc) {
var addEvent = 'addEventListener',
type = 'gesturestart',
qsa = 'querySelectorAll',
scales = [1, 1],
meta = qsa in doc ? doc[qsa]('meta[name=viewport]') : [];
function fix() {
meta.content = 'width=device-width,minimum-scale=' + scales[0] + ',maximum-scale=' + scales[1];
@kujon
kujon / LICENSE.txt
Created March 15, 2012 19:09 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
/**
* @constructor
*/
function Injector() {
/**
* @type {!Object.<string, function(Injector=): !Object>}
*/
this.factories = {};
@kujon
kujon / samplerest.js
Last active August 27, 2015 22:24 — forked from joshbirk/samplerest.js
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')