Skip to content

Instantly share code, notes, and snippets.

View argyleink's full-sized avatar
💀
calc(dev*design)

Adam Argyle argyleink

💀
calc(dev*design)
View GitHub Profile
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 4, 2024 21:33
A badass list of frontend development resources I collected over time.
@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

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 out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@ninjascribble
ninjascribble / user-agent-match.js
Created March 8, 2013 22:07
user agent matching on the client-side
/** 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,
@ninjascribble
ninjascribble / node-user-agent.js
Last active December 22, 2023 02:42
Fetching the user-agent string from a request using either NodeJS or NodeJS + Express
/** 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')
@ninjascribble
ninjascribble / gist:4602255
Last active December 11, 2015 12:38
jQuery $.Deferred chaining example. jsfiddle: http://jsfiddle.net/B5eZ9/1/
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();
@tbeseda
tbeseda / isMobile.js
Last active December 11, 2015 10:48
// 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');
@eklimcz-zz
eklimcz-zz / touchEventWireup
Created September 25, 2012 16:52
Cross browser touch event wireup
function inferInputModel() {
if (window.navigator.msPointerEnabled) {
return 'pointer';
} else if (window.ontouchstart !== undefined) {
return 'touch';
} else {
return 'unknown';
}
}
@jaydeepw
jaydeepw / enableHTML5AppCache.java
Last active October 5, 2023 11:39
Enabling HTML5 AppCache in Android Webview programatically.
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");
@Mparaiso
Mparaiso / main.js
Created July 24, 2012 12:15
three.js, TweenLite , Coordinates.js
var camera,
scene,
renderer,
group,
grid,
wave ,
mesh,
currentLayout,
container,
layoutNames,
@mattyoho
mattyoho / ios-test.css
Created October 19, 2011 19:12 — forked from tonywok/ios-test.css
iOS Media Queries
// 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 {