Skip to content

Instantly share code, notes, and snippets.

@souparno
souparno / cors.js
Created July 21, 2014 13:18 — forked from eriwen/cors.js
/**
* Make a X-Domain request to url and callback.
*
* @param url {String}
* @param method {String} HTTP verb ('GET', 'POST', 'DELETE', etc.)
* @param data {String} request body
* @param callback {Function} to callback on completion
* @param errback {Function} to callback on error
*/
function xdr(url, method, data, callback, errback) {
@souparno
souparno / php mvc
Created August 1, 2014 13:43
php mvc
http://www.sitepoint.com/the-mvc-pattern-and-php-1/
http://www.sitepoint.com/the-mvc-pattern-and-php-2/
@souparno
souparno / mysql relation
Created August 4, 2014 15:44
mysql relation
ALTER TABLE user
ADD CONSTRAINT fk_Pin
FOREIGN KEY (pin_no)
REFERENCES pin(pin_no)
ON DELETE CASCADE
ON UPDATE CASCADE
@souparno
souparno / .htaccess file ,subdomain and cakePHP
Created October 5, 2014 08:36
.htaccess file ,subdomain and cakePHP
onsider a domain www.example.com. You have created an appliaction in its root folder.
Now you purchase a new subdomain www.newdomain.net that is like root/newdomain/ in your server.
When you place your cake application inside this newdomain folder, you will encounter problem regarding
redirect, sometimes you css will be not getting loaded same is with javascript and images.
To overcome this problem create 3 .htaccess files in this order:-
1) .htaccess file in root/newdomain/ folder write this:-
<IfModule mod_rewrite.c>
RewriteEngine on
@souparno
souparno / linked list
Created October 29, 2014 04:18
linkedlist
import java.io.*;
class LinkedList {
Node last = null;
// function to create the link list
public void createList(int n) {
Node node = new Node();
node.value = n;
@souparno
souparno / getApp.js
Last active August 29, 2015 14:11 — forked from marcusoftnet/getApp.js
var app = require("express")();
app.get('/user', function(req, res){
res.send(200, { name: 'marcus' });
});
// In order to reach the app from other modules
// we need to export the express application
module.exports.getApp = app;
@souparno
souparno / .conf
Created June 19, 2015 18:43
.conf file to create virtual host
<VirtualHost *:80>
ServerName Bonfire.local
DocumentRoot /var/www/Bonfire.local
<Directory /var/www/Bonfire.local>
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
@souparno
souparno / building cordova with ant
Created July 12, 2015 07:53
building cordova with ant
cordova build android -- --ant
@souparno
souparno / gist:f077cb03f0339514bbcc
Created November 28, 2015 05:20 — forked from zachstronaut/gist:1184900
Stretch HTML5 canvas to fill window, preserving aspect ratio
/**
* fullscreenify()
* Stretch canvas to size of window.
*
* Zachary Johnson
* http://www.zachstronaut.com/
*
* See also: https://gist.github.com/1178522
*/
@souparno
souparno / .bshrc
Created January 1, 2016 12:13
my .bashrc
export ANDROID_HOME=/home/bonnie/Android/Sdk
export PATH=${ANDROID_HOME}/tools:${PATH}
export PATH=${ANDROID_HOME}/platform-tools:${PATH}
export PATH=${ANDROID_HOME}/build-toold:${PATH}
export PATH=${ANDROID_HOME}/../android-ndk-r10e:${PATH}
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64