Skip to content

Instantly share code, notes, and snippets.

View nurfarazi's full-sized avatar
🎯
Focusing

nur farazi nurfarazi

🎯
Focusing
  • Kaz Software
  • Bangladesh
View GitHub Profile
@nurfarazi
nurfarazi / getdatafromurl.js
Created October 26, 2015 08:29
get data from url
var fullparam = window.location.href;
var parts = fullparam.split('/', 7);
var SellectedIMEI = parts[4];
var longitud = parts[5];
var latitude = parts[6];
<!DOCTYPE html>
<html>
<head>
<style>
html {
width: 100%;
height: 100%;
}
body {
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('hello world\n');
}).listen(8000, '127.0.0.1');
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('hello\n');
setTimeout(function(){
res.end('world\n');
},2000);
}).listen(8000, '127.0.0.1');
var net = require('net');
net.createServer(function(socket){
socket.write('hello\n');
socket.write('world\n');
socket.on('data', function(data){
socket.write(data.toString().toUpperCase())
});
}).listen(8000);
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
// Application
var net = require('net');
var sockets = [];
net.createServer(function(socket){
// Load the net module to create a tcp server.
var net = require('net');
// Creates a new TCP server. The handler argument is automatically set as a listener for the 'connection' event
var server = net.createServer(function (socket) {
// Every time someone connects, tell them hello and then close the connection.
console.log("Connection from " + socket.remoteAddress);
socket.end("Hello World\n");
var app = angular.module('app', []);
app.controller('controler', function ($scope, $http) {
$scope.ok = "testing";
});
[1,2,3,4,5,6].reduceRight(function(a,b){return a+b;})
@nurfarazi
nurfarazi / java script splict and get user id.txt
Created November 18, 2015 08:59
java script splict and get user id
var fullparam = window.location.href;
var parts = fullparam.split('/', 7);
var gotit = parts[4];
var userid = gotit.replace(/#/g, '');