Skip to content

Instantly share code, notes, and snippets.

View eirsyl's full-sized avatar

Eirik Martiniussen Sylliaas eirsyl

View GitHub Profile

Keybase proof

I hereby claim:

  • I am eirsyl on github.
  • I am eirsyl (https://keybase.io/eirsyl) on keybase.
  • I have a public key whose fingerprint is FF83 EAC2 B89D 8193 94B8 F36F 826D 41C9 C567 94A7

To claim this, I am signing this object:

@eirsyl
eirsyl / django_best_practices
Created November 11, 2014 12:06
Django tips & tricks by Webcom
{% block extrahead %}
{% if not user.logged_in %}
<meta http-equiv="REFRESH" content="0;url={% url 'nerd.app.frontpage.views.index' %}">
{%endif %}
{% endblock %}
@eirsyl
eirsyl / dump_restore_postgres
Created February 17, 2014 23:29
Dump / Restore Postgres Database
su postgres
pg_dump dbname > outfile
psql dbname < infile
# Chango owner onn all tables
for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" "dbname"` ; do psql -c "alter table $tbl owner to ownername" "dbname" ; done