Data URI manipulation made easy.
This isn't very robust, and will reject a number of valid data URIs. However, it meets the most useful case: a mimetype, a charset, and the base64 flag.
<script> | |
// manually bootstrapping app in order to have cordova (And plugins loaded) ready to go | |
// (remove the "ng-app" attribute from your markup) | |
angular.element(document).ready(function() { | |
if (window.cordova) { | |
document.addEventListener('deviceready', function() { | |
angular.bootstrap(document.body, ['starter']); | |
}, false); | |
} else { | |
angular.bootstrap(document.body, ['starter']); |
Deploy Django-Nginx-uwsgi pada web faction | |
referensi: http://community.webfaction.com/questions/10242/installing-nginx-uwsgi | |
APPNAME="tracker" | |
/home/narayana/webapps/tracker | |
bin | |
start | |
stop |
#!/bin/sh | |
KEY="$HOME/.ssh/id_rsa.pub" | |
if [ ! -f ~/.ssh/id_rsa.pub ];then | |
echo "private key not found at $KEY" | |
echo "* please create it with "ssh-keygen -t dsa" *" | |
echo "* to login to the remote host without a password, don't give the key you create with ssh-keygen a password! *" | |
exit | |
fi |
<script> | |
var djangoConfig = { | |
staticUrl : '{{STATIC_URL}}' | |
}; | |
var getStaticPath = function(url){ | |
return djangoConfig.staticUrl + url; | |
}; | |
</script> |
(function () { | |
'use strict'; | |
var angularApp = angular.module("angularApp", ['restangular']); | |
angularApp.config(['$httpProvider', function($httpProvider){ | |
$httpProvider.defaults.useXDomain = true; | |
$httpProvider.defaults.withCredentials = true; | |
delete $httpProvider.defaults.headers.common['X-Requested-With']; |
(function (){ | |
jQuery.fn.highlight = function (text, o) { | |
return this.each( function(){ | |
var replace = o || '<span class="highlight">$1</span>'; | |
$(this).html( $(this).html().replace( new RegExp('('+text+'(?![\\w\\s?&.\\/;#~%"=-]*>))', "ig"), replace) ); | |
}); |
# Installing OpenCV python libs on mac to work with virtualenv | |
# OpenCV 2.4.3 | |
# Python 2.7.3 installed with brew | |
# assuming you have virtualenv, pip, and python installed via brew | |
# assuming $WORKON_HOME is set to something like ~/.virtualenvs | |
# using homebrew - make sure we're current | |
brew update |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
html, body{ | |
height:100%; | |
margin:0; | |
padding:0; | |
} |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
html, body{ | |
height:100%; | |
margin:0; | |
padding:0; | |
} |