Skip to content

Instantly share code, notes, and snippets.

View bianchimro's full-sized avatar
🤡

Mauro Bianchi bianchimro

🤡
View GitHub Profile
@bianchimro
bianchimro / index.html
Last active August 29, 2015 14:18
manually bootstrapping angular app with cordova
<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']);
@bianchimro
bianchimro / nginx.conf
Last active August 29, 2015 14:11 — forked from widoyo/nginx.conf
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
@bianchimro
bianchimro / ssh_keys_upload.sh
Created October 17, 2014 08:53
SSH KEYS UPLOAD
#!/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

DataURI.py

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.

Parsing

@bianchimro
bianchimro / gist:d032365a360bab7a1f8d
Last active August 29, 2015 14:00
django config in template
<script>
var djangoConfig = {
staticUrl : '{{STATIC_URL}}'
};
var getStaticPath = function(url){
return djangoConfig.staticUrl + url;
};
</script>
@bianchimro
bianchimro / gist:11396501
Created April 29, 2014 10:38
Restangular tastypie configuration with cross origin
(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'];
# 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;
}