Skip to content

Instantly share code, notes, and snippets.


Marcelo Leiva marceloleiva

View GitHub Profile
View Textos a profundidad.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
X-Wei / sliver_appbar_with_tabs.dart
Created Jul 29, 2018
Demo of using SliverAppbar with tabs.
View sliver_appbar_with_tabs.dart
// Sliver appbar with tabs.
// Adapted from:
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
home: SilverAppBarWithTabBarScreen(),
class SilverAppBarWithTabBarScreen extends StatefulWidget {
mdesantis /
Last active Aug 17, 2020 — forked from delameko/
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04


Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main
MrYoda /
Last active Aug 10, 2020
Python 3, Django 1.9+: Excel file creation and send on-the-fly with XlsxWriter & BytesIO
import xlsxwriter
from io import BytesIO
from django.http import StreamingHttpResponse
from django.views.generic import View
def get_foo_table_data():
Some table data
delameko /
Last active May 21, 2021 — forked from johanndt/
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04


Install Postgres 9.6, and then:

sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
goutham2027 /
Last active Jul 12, 2016
using django reversion
pip install django-reversion

Add reversion to INSTALLED_APPS

kidpixo /
Last active Jul 28, 2021
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Warning This is SEVERELY outdated, the current jupyter version is > 6.X, please refer to your current jupyter notebook installation!

Disclaimer : I just copied those shortcuts from Jupyter Menú > Help > Keyboard Shortcuts, I didn't wrote them myself.

Check your current shortcuts in your Help, shortcuts coule have been modified by extensions or your past self.


Keyboard shortcuts

cordova plugin add
from itertools import chain
from operator import attrgetter
# ascending oreder
result_list = sorted(
chain(queryset1, queryset2),
# descending order
douglasmiranda /
Last active Jul 9, 2021
Fix: Django Debug Toolbar not showing when using with Docker.
# YOU MAY WANT TO CHECK THIS OUT:{{cookiecutter.django_project_name}}/{{cookiecutter.django_project_name}}/config/
# If you don't do this you will have to add the host IP in INTERNAL_IPS = ('',)
# And it will change, then you will have to change INTERNAL_IPS again.
def show_toolbar(request):
if request.is_ajax():
return False
return True