First, make sure you use the SessionAuthentication in Django. Put this in your settings.py
# Django rest framework
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': [
'rest_framework.authentication.SessionAuthentication'
var fr = new FileReader(), buf, file = element.files[0]; | |
var etags = []; | |
var partSize = 6 * 1024 * 1024; // constant | |
var totalSize = file.size; | |
var numParts = Math.ceil(totalSize / partSize); | |
var key = null; | |
var uplaodId = null; | |
// 1. Init Upload | |
coverService.initUpload({fileName: file.name, fileType: 'video'}, function(res){ |
var fs = require('fs'); | |
function checkFiles(list){ | |
list.forEach((path) => { | |
if (!fs.existsSync(path)) { | |
console.log('-- Not found '+path) | |
} | |
}) | |
} | |
cd $HOME | |
ln -s `which php56` ~/bin/php | |
export PATH=$HOME/bin:$PATH | |
curl -sS https://getcomposer.org/installer | php56 | |
echo -e "\n# Composer\nalias composer=\"php56 \$HOME/composer.phar\"" >> $HOME/.bash_profile | |
source $HOME/.bash_profile |
//********* load image if src dont found **********// | |
myApp.directive('onErrorSrc', function() { | |
return { | |
link: function(scope, element, attrs) { | |
if(!attrs.src){ | |
attrs.$set('src', attrs.onErrorSrc); | |
return; | |
} |
# author: | |
# @Bartosz Kosarzycki | |
# | |
sudo apt-get install npm | |
sudo npm install -g react-native-cli | |
sudo ln -s /usr/bin/nodejs /usr/bin/node | |
cd /home/user/your/project/path | |
react-native init AwesomeProject | |
cd AwesomeProject |
# bootstrap/app.php | |
//if production .env set APP_PUBLIC=../hogarExperto/ for example | |
if(env('APP_PUBLIC') != NULL){ | |
$app->bind('path.public', function() { | |
return base_path().env('APP_PUBLIC'); | |
}); | |
} |
############################################# | |
# Push de la rama actual | |
git push origin $rama_actual | |
############################################# | |
# Volver a un commit anterior, descartando los cambios | |
git reset --HARD $SHA1 | |
############################################# | |
# Ver y descargar Ramas remotas |
//Modal | |
.modal.fade .modal-dialog { | |
-webkit-transform: scale(0.1); | |
-moz-transform: scale(0.1); | |
-ms-transform: scale(0.1); | |
transform: scale(0.1); | |
top: 300px; | |
opacity: 0; | |
-webkit-transition: all 0.3s; | |
-moz-transition: all 0.3s; |
//Facebook login | |
$scope.fbLogin = function() { | |
$cordovaOauth.facebook("1495786770635908", ["email"]).then(function(result) { | |
//alert(result.access_token); | |
$token = result.access_token; | |
$ionicLoading.show(); | |
$http.get('https://graph.facebook.com?access_token='+$token+'&ids=me').success(function(data){ | |
sendData = { | |
id: data.me.id, | |
username: data.me.first_name, |