Skip to content

Instantly share code, notes, and snippets.

@bilalel
bilalel / django-db.py
Created September 8, 2014 21:22
sync db with south
# south
# convert to south
# http://south.readthedocs.org/en/latest/convertinganapp.html
0. add south to INSTALLED_APPS
1. ./manage.py syncdb
2. ./manage.py convert_to_south app_name
---
south - create new column
0. # new app, new models, initial fields
1. manage.py schemamigration app_name --initial # (only once)
@bilalel
bilalel / local_settings.py
Created September 8, 2014 20:52
django - settings
"""Local settings of this project"""
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# PATH settings
TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')
STATIC_PATH = os.path.join(BASE_DIR, 'static')
@bilalel
bilalel / app_urls.py
Created September 8, 2014 20:38
django urls config
from django.conf.urls import patterns, url
from ictpart import views
urlpatterns = patterns('',
url(r'^index/$', views.index, name='index'),
)
@bilalel
bilalel / link-img-album.py
Last active August 29, 2015 14:05
Get the cover of an album in the Google Play Music Store
@bilalel
bilalel / link-album.py
Created August 29, 2014 15:29
Get link to an album on the Google Play Music Store
@bilalel
bilalel / android-tps-tricks
Last active August 29, 2015 13:59
Some tips and tricks about android animation
Android animation links:
tktutorials - http://www.tktutorials.com/2013/07/animation-in-android-using-xml-files.html
vogella - (http://www.vogella.com/tutorials/AndroidAnimation/article.html#animations_animator)
vogella - http://www.vogella.com/tutorials/android.html
mokasocial - http://www.mokasocial.com/2011/07/7-simple-useful-android-xml-animations/
--------
LinearLayout
<LinearLayout android:background="@color/red"
.... />
@bilalel
bilalel / gist:10630807
Last active August 29, 2015 13:59
sheel cheat sheet
#vim - src : http://linux.startcom.org/docs/en/Introduction%20to%20Linux/sect_06_02.html
Basic operations
----------------
n dd - will delete n lines starting from the current cursor position.
n dw - will delete n words at the right side of the cursor.
x - will delete the character on which the cursor is positioned
:n - moves to line n of the file.
:w - will save (write) the file
:q - will exit the editor.
:q! - forces the exit when you want to quit a file containing unsaved changes.