This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>getCurrentPosition redirect</title> | |
<meta name="description" content="Redirect depending on whether or not the user accepts location sharing"> | |
<meta name="author" content="Gaël Billon"> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp.directives', []). | |
directive('keepoldvalueifnewisempty', function() { | |
return { | |
restrict: "E", | |
link: function(scope, elm, attrs) { | |
scope.$watch(attrs.val, function (newValue, oldValue) { | |
newValue = !newValue ? oldValue : newValue; | |
elm.html(newValue); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style media="screen" type="text/css"> | |
h1 { | |
color: darkgrey; | |
background-color: lightgrey; | |
} | |
h2 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android update project -p . -s -t android-16 | |
cp ../xxx/mobile/final_version assets/www | |
adb uninstall com.xxxx.xxxx | |
ant clean | |
ant debug | |
adb install bin/xxxxg.apk | |
adb shell am start -n com.xxxx.xxxx/com.xxxx.xxxx.xxxx (last xxxx is activity name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TRIGGER | |
newid | |
BEFORE INSERT ON | |
table_name | |
FOR EACH ROW | |
SET NEW.id = UUID() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Press "right arrow" -> "down arrow" -> "lowercase o" to show hide a div | |
$('body').bind('keydown', function(e) { | |
if (typeof(keyPressed) == "undefined") { | |
keyPressed = []; | |
} | |
var code = (e.keyCode ? e.keyCode : e.which); | |
keyPressed.push(code); | |
if (keyPressed.length === 3) { | |
if (keyPressed[0] === 39 && keyPressed[1] === 40 && keyPressed[2] === 79) { | |
$('#bloc_users').toggle() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.body.parentNode.outerHTML.length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### ENVIRONMENT VARIABLES ### | |
SetEnv PHP_VER 5 | |
SetEnv REGISTER_GLOBALS 0 | |
### MAIN DEFAULTS ### | |
Options All -Indexes | |
DirectoryIndex index.html index.htm index.php | |
AddDefaultCharset UTF-8 | |
### MIME TYPES ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onresize = function(event) { | |
console.log("x: " + window.innerWidth+" y: " + window.innerHeight); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="javascript:localStorageSize=null;for(var a=0;a<localStorage.length;a++)localStorageSize+=localStorage.getItem(localStorage.key(a)).length;var b=localStorageSize,c=['Bytes','KB','MB','GB','TB'];if(0==b)localStorageSize='n/a';else{var d=parseInt(Math.floor(Math.log(b)/Math.log(1024)),10);localStorageSize=0==d?b+' '+c[d]:(b/Math.pow(1024,d)).toFixed(1)+' '+c[d]}alert('localStorage is : '+localStorageSize);">localStorage Size</a> |