Skip to content

Instantly share code, notes, and snippets.

View leecrossley's full-sized avatar

Lee Crossley leecrossley

View GitHub Profile
@leecrossley
leecrossley / AndroidManifest.xml
Last active August 29, 2015 14:03
Android app phones only (not tablets)
<manifest>
<compatible-screens>
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<screen android:screenSize="small" android:screenDensity="480" />
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
@EddyVerbruggen
EddyVerbruggen / iOS8 Beta Phonegap fix
Last active December 8, 2018 05:28
iOS8 Beta Phonegap fix: manually set the navigator.userAgent
// temp fix for iOS8 beta 1 (fixed in beta 2), add it after the reference to cordova.js
if (navigator.userAgent === undefined) {
navigator.__defineGetter__('userAgent', function() {
return("Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit");
});
}
@leecrossley
leecrossley / shake.js
Last active December 28, 2021 10:56
Shake gesture detection in PhoneGap / Cordova
/*
THIS GIST IS OUT OF DATE AND NOT MONITORED
PLEASE SEE https://github.com/leecrossley/cordova-plugin-shake-detection
*/
var shake = (function () {
var shake = {},
watchId = null,
options = { frequency: 300 },
previousAcceleration = { x: null, y: null, z: null },
@leecrossley
leecrossley / FuzzBuzz with CSS
Created May 7, 2012 17:40
There's no JavaScript or markup content :)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>FuzzBuzz with CSS</title>
<style type="text/css">
body{counter-reset:fuzzbuzz;font-family:arial;font-size:18px;}
div{padding:10px;margin:10px;width:80px;float:left;height:30px;color:#999;text-align:center;}
div:after{content:counter(fuzzbuzz);counter-increment:fuzzbuzz;}
div:nth-child(3n):not(:nth-child(5n)):after{content:"fuzz";color:red;font-weight:bold;}
@leecrossley
leecrossley / Happy Panda.
Created March 28, 2012 12:36
Panda: without context splurge, callbacks or base library.
var panda = (function () {
var panda = {}, bambooLevel = 0, isAsleep = false;
function wakeUp() {
isAsleep = false;
}
panda.eatBamboo = function () {
bambooLevel = bambooLevel + 1;
};
public class NoMethodActionDescriptor : ActionDescriptor {
public readonly string httpMethod;
public NoMethodActionDescriptor(string httpMethod)
{
this.httpMethod = httpMethod;
}
public override object Execute(ControllerContext controllerContext, IDictionary<string, object> parameters)
{