Skip to content

Instantly share code, notes, and snippets.

View quamilek's full-sized avatar

Kamil Warguła quamilek

  • Allegro Group
  • Poznań, Poland
View GitHub Profile
matrix = [
[2,1,4,0,],
[4,-1,13,-1,],
[-6,-3,-13,5,],
[-2,-13,18,-16,]
]
b_matrix = [1,2,0,-3]
#django-debug-toolbar
DEBUG_TOOLBAR = True
if DEBUG_TOOLBAR:
INTERNAL_IPS = ('127.0.0.1',)
MIDDLEWARE_CLASSES += (
'debug_toolbar.middleware.DebugToolbarMiddleware',
)
INSTALLED_APPS += (
'debug_toolbar',
@quamilek
quamilek / libraries.rst
Created February 19, 2013 07:54
List useful python libraries

Git Branch Removal

To remove the local branch:

git branch -d the_local_branch

To remove the remote branch:

@quamilek
quamilek / django_logging_sql_queries.md
Last active December 15, 2015 13:39
Logging SQL queries in Django

#Logging SQL queries in Django

Add in your settings-local.py:

LOGGING['loggers']['django.db.backends'] = {
    'handlers': ['console'],
    'propagate': True,
    'level': 'DEBUG',
}
<dict>
<key>name</key>
<string>SublimeLinter Annotations</string>
<key>scope</key>
<string>sublimelinter.annotations</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#FFFFAA</string>
<key>foreground</key>
@quamilek
quamilek / mysql_disable_foregin_keys
Created May 8, 2013 11:25
MySQL – Disable Foreign Key Checks or Constraints
SET foreign_key_checks = 0;
YOUR QUERY;
SET foreign_key_checks = 1;
@quamilek
quamilek / django_uml_models.txt
Created September 26, 2013 11:15
uml django models
Getting It
You can get Django Extensions by using pip or easy_install:
$ pip install django-extensions
or
$ easy_install django-extensions
If you want to install it from source, grab the git repository from GitHub and run setup.py:
$ git clone git://github.com/django-extensions/django-extensions.git
@quamilek
quamilek / copy_img_to_raspberry.sh
Created January 12, 2014 19:44
Copy os image to sdcard Raspberry pi
sudo dd bs=4M if=/path/to/image of=/dev/sdc
@quamilek
quamilek / csv-splitter.py
Created May 13, 2014 09:47
Simple csv splitter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def split_file(file_name, max_line_count):
header = None
new_file_counter = 1
line_counter = 0