Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Either copy the aliases from the .gitconfig
or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4
- creates local branch pr/4
from the github upstream
(if it exists) or origin
remote and checks it outgit pr 4 someremote
- creates local branch pr/4
from someremote
remote and checks it out/** User-agent pattern matching */ | |
var browser = 'unknown' | |
, version = 'unknown' | |
, patterns = { | |
android: /android\s([0-9.]*)/i | |
chrome: /chrome\/([0-9.]*)/i, | |
firefox: /firefox\/([0-9.]*)/i, | |
ie: /msie\s([0-9.]*)/i, | |
ipad: /ipad.version\/([0-9.]*).safari/i, | |
iphone_4: /iphone\sos\s4.version.mobile\/([0-9.]*).safari/i, |
/** Native NodeJS */ | |
var http = require('http') | |
, server = http.createServer(function(req) { | |
console.log(req.headers['user-agent']); | |
}); | |
server.listen(3000, 'localhost'); | |
/** NodeJS with Express */ | |
var express = require('express') |
var a = getPromise(50) | |
, b = getPromise.bind(document, 1200) | |
, c = getPromise.bind(document, 400); | |
a.then(b).then(c).done(finish); | |
function getPromise(ttl) { | |
var deferred = $.Deferred(); | |
// Simple method to detect a mobile device | |
function isMobile(){ | |
return (/iphone|ipod|android|blackberry/).test(navigator.userAgent.toLowerCase()); | |
} | |
// Example usage: | |
if(isMobile()){ | |
console.log('This is a mobile device.'); | |
} else { | |
console.log('This is not a mobile device'); |
function inferInputModel() { | |
if (window.navigator.msPointerEnabled) { | |
return 'pointer'; | |
} else if (window.ontouchstart !== undefined) { | |
return 'touch'; | |
} else { | |
return 'unknown'; | |
} | |
} |
private void enableHTML5AppCache() { | |
webView.getSettings().setDomStorageEnabled(true); | |
// Set cache size to 8 mb by default. should be more than enough | |
webView.getSettings().setAppCacheMaxSize(1024*1024*8); | |
// This next one is crazy. It's the DEFAULT location for your app's cache | |
// But it didn't work for me without this line | |
webView.getSettings().setAppCachePath("/data/data/"+ getPackageName() +"/cache"); |
var camera, | |
scene, | |
renderer, | |
group, | |
grid, | |
wave , | |
mesh, | |
currentLayout, | |
container, | |
layoutNames, |
// iOS Media Queries | |
// Goal: capture styles for iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2 | |
// | |
// Author: Tony Schneider (@tonywok) | |
// Please tell me where I fail. :) | |
// iPhone v(4,4S) portrait | |
// test: black text (overwritten by v* portrait) with blue background | |
@media all and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) { | |
a { |