Skip to content

Instantly share code, notes, and snippets.

View rupakraj's full-sized avatar

Rupak Raj Ghimire rupakraj

View GitHub Profile
@rupakraj
rupakraj / format_nepali_money
Created July 13, 2014 03:11
Php function to format the money in Rs. (Nepali)
function money_format_nep($number, $is_unicode=true)
{
//number_format($number,".");
if(strstr($number,"-"))
{
$number = str_replace("-","",$number);
$negative = "-";
}
@rupakraj
rupakraj / django-setup
Created January 25, 2015 08:33
Setup the Django and run upto hello world
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)
@rupakraj
rupakraj / django-setup
Created January 25, 2015 08:34
Setup the Django and run upto hello world
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)
@rupakraj
rupakraj / gist:54488f445c06876642fc
Last active August 29, 2015 14:19
Install Sublime text in Ubuntu
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
@rupakraj
rupakraj / pulseaudio-trouble.txt
Created August 16, 2015 06:21
Linux - Resetting the sound card
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.
@rupakraj
rupakraj / GPSTracker.java
Created August 18, 2015 07:04
To get the current location of the android phone; GPS; Traking
package np.com.rupakraj.util;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
@rupakraj
rupakraj / PostGreSQL Default Password
Created September 3, 2015 08:24
To change the default password of the the PostGreSQL
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:
@rupakraj
rupakraj / PostGreSQl - Installer
Created September 3, 2015 08:29
Intalling the post GreSQL using standard package manger apt-get in ubuntu
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
@rupakraj
rupakraj / DateTime.java
Last active September 14, 2017 12:58
Date Time Class for Java
package util;
import java.util.Calendar;
/**
* Created by rupak on 10/14/15.
* Use: DateTime.getDate().ToDateTime()
* Explore static methods
*/
@rupakraj
rupakraj / install_update_ruby
Created November 11, 2015 07:49
Installing and Updating the Ruby on Ubuntu 10.04
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