This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setup the Django and run upto hello world | |
========================================= | |
Install python and python-pip | |
then use the pip to install the python | |
pip install Django==1.7.3 | |
To check if installed properly (Go to pythong CLI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Setup the Django and run upto hello world | |
========================================= | |
Install python and python-pip | |
then use the pip to install the python | |
pip install Django==1.7.3 | |
To check if installed properly (Go to pythong CLI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For Sublime-Text-2: | |
sudo add-apt-repository ppa:webupd8team/sublime-text-2 | |
sudo apt-get update | |
sudo apt-get install sublime-text | |
For Sublime-Text-3: | |
sudo add-apt-repository ppa:webupd8team/sublime-text-3 | |
sudo apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install the pulseaudio in the xubuntu. If pulseaudio is already installed skip the following commad | |
$sudo apt-get install pulseaudio | |
Then you can start pulseaudio as follows | |
$sudo start-pulseaudio-x11 start | |
The start-pulseaudio-x11 start also works in if you are getting sound on the headphione only. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To change the default password of the the PostGreSQL Postgres user from command line tool :psql | |
User: postgres | |
Tool: Psql | |
Enter on the command line: | |
$ sudo -u postgres psql postgres | |
$\# \password postgres | |
You'll see: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Following main and supporting packages are required | |
postgresql-client-9.4 - client libraries and client binaries | |
postgresql-9.4 - core database server | |
postgresql-contrib-9.4 - additional supplied modules | |
libpq-dev - libraries and headers for C language frontend development | |
postgresql-server-dev-9.4 - libraries and headers for C language backend development | |
pgadmin3 - pgAdmin III graphical administration utility | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First of all, install the prerequisite libraries: | |
sudo apt-get update | |
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev | |
Then install rbenv, which is used to install Ruby: | |
cd | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using Select(): a power of LINQ for casting datatable into List of Object | |
List<Student> target = dt.AsEnumerable() | |
.Select(row => new Student | |
{ | |
// assuming column 0's type is Nullable<long> | |
StudentID = row.Field<long?>(0).GetValueOrDefault(), | |
StudentName = String.IsNullOrEmpty(row.Field<string>(1)), | |
}).ToList(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gcm = require('node-gcm'); | |
var notify = exports; | |
notify.send = function(msg, reg_id) { | |
var message = new gcm.Message(); | |
message.addData('msg', msg); | |
// get token here | |
// TODO | |
//var regTokens = ['APA91bFiJx52Iq2_LwyXPUWeO0Vg-9DmrWW6E6BmjwNUtTIrWRNOIDzaCmOidzndjZE3zWvL248GtqBYIV7YsD9q37M0urFz3FD6DvYkOaVqJqV3V9CciPletqzbJqvEm-54cpwMNcxP']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WARNING: its hard reset, means all the data or log will be removed | |
To reset the django migration to initial follow following order | |
* Remove database | |
* Remove all the contents of django app's migrations folder except __init__.py file. | |
* The remaining migrations folder should be something like | |
myapp | |
├── migrations | |
│ │ ├── __init__.py |
OlderNewer