Skip to content

Instantly share code, notes, and snippets.

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
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: https://stackoverflow.com/a/50858058
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
home: SilverAppBarWithTabBarScreen(),
));
class SilverAppBarWithTabBarScreen extends StatefulWidget {
@mdesantis
mdesantis / upgrade-postgres-9.6-to-10.md
Last active Aug 17, 2020 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04
View upgrade-postgres-9.6-to-10.md

TL;DR

Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main
@MrYoda
MrYoda / views.py
Last active Aug 10, 2020
Python 3, Django 1.9+: Excel file creation and send on-the-fly with XlsxWriter & BytesIO
View views.py
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
delameko / upgrade-postgres-9.5-to-9.6.md
Last active Nov 22, 2020 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.5 to 9.6 on Ubuntu 16.04
View upgrade-postgres-9.5-to-9.6.md

TL;DR

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
goutham2027 / django_reversion.md
Last active Jul 12, 2016
using django reversion
View django_reversion.md
pip install django-reversion

Add reversion to INSTALLED_APPS

INSTALLED_APPS = [
...
...
...
@kidpixo
kidpixo / jupyter_shortcuts.md
Last active May 2, 2021
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter
View jupyter_shortcuts.md

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.

Toc

Keyboard shortcuts

View addsqlite.sh
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
View query.py
from itertools import chain
from operator import attrgetter
# ascending oreder
result_list = sorted(
chain(queryset1, queryset2),
key=attrgetter('date_created'))
# descending order
@douglasmiranda
douglasmiranda / option1.py
Last active May 7, 2021
Fix: Django Debug Toolbar not showing when using with Docker.
View option1.py
# YOU MAY WANT TO CHECK THIS OUT: https://github.com/douglasmiranda/ddpt/blob/master/{{cookiecutter.django_project_name}}/{{cookiecutter.django_project_name}}/config/local.py
# If you don't do this you will have to add the host IP in INTERNAL_IPS = ('127.0.0.1',)
# 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