Skip to content

Instantly share code, notes, and snippets.

Avatar

Lee Crossley leecrossley

View GitHub Profile
@leecrossley
leecrossley / AndroidManifest.xml
Last active Aug 29, 2015
Android app phones only (not tablets)
View AndroidManifest.xml
<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 Dec 8, 2018
iOS8 Beta Phonegap fix: manually set the navigator.userAgent
View iOS8 Beta Phonegap fix
// 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 Feb 8, 2021
Shake gesture detection in PhoneGap / Cordova
View shake.js
/*
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
There's no JavaScript or markup content :)
View FuzzBuzz with CSS
<!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 Mar 28, 2012
Panda: without context splurge, callbacks or base library.
View Happy Panda.
var panda = (function () {
var panda = {}, bambooLevel = 0, isAsleep = false;
function wakeUp() {
isAsleep = false;
}
panda.eatBamboo = function () {
bambooLevel = bambooLevel + 1;
};
View gist:1376080
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)
{