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 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 |
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){ |
# 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 |
public static function getEventSlug($title) { | |
$slug = Str::slug($title); | |
$slugCount = count( Service::whereRaw("slug REGEXP '^{$slug}(-[0-9]*)?$'")->get() ); | |
return ($slugCount > 0) ? "{$slug}-{$slugCount}" : $slug; | |
} |
# 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'); | |
}); | |
} |
//********* 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; | |
} |
############################################# | |
# 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; |