$ docker pull postgres$ mkdir -p [db-volume-location-on-machine]| " plugins | |
| let need_to_install_plugins = 0 | |
| if empty(glob('~/.vim/autoload/plug.vim')) | |
| silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
| \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| let need_to_install_plugins = 1 | |
| endif | |
| call plug#begin() | |
| Plug 'tpope/vim-sensible' |
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
In this tutorial we are going to build a Twitter clone using Django and GetStream.io, a hosted API for newsfeed development. We will show you how easy is to power your newsfeeds with GetStream.io. At the end of this tutorial we will have a Django app with a profile feed, a timeline feed, support for following users, hashtags and mentions.
I assume that you are familiar with Django. If you're new to Django the [official tutorial] (https://docs.Djangoproject.com/en/1.7/intro/install/) explains it very well.
Bootstrap the Django application
| #-*- coding: utf-8 -*- | |
| import urlparse | |
| from django.contrib.auth import REDIRECT_FIELD_NAME, login | |
| from django.contrib.auth.forms import AuthenticationForm | |
| from django.http import HttpResponseRedirect | |
| from django.utils.decorators import method_decorator | |
| from django.views.decorators.cache import never_cache | |
| from django.views.decorators.csrf import csrf_protect | |
| from django.views.generic.edit import FormView | |
| from django.conf import settings |
| /** | |
| * Este script de javascript permite trabajar transparentemente solicitudes que requieren | |
| * protección del token CSRF por medio de AJAX JQUERY. | |
| * Esto te permitirá hacer solcitudes a web Services de Django por medio de AJAX Jquery. | |
| * Para utilizarlo basta con integrar el archivo DjangoAjax.js en tu directorio de JS y hacer referencia a él en tus templates | |
| * que requieren del uso de AJAX por POST o algún otro que requiera el token CSRF. | |
| * Este script está basado en la documentación oficial de Django https://docs.djangoproject.com | |
| */ | |
| $(function(){ |
| ############################################# | |
| # 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 |