Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Siddhesh Rane sid24rane

🎯
Focusing
  • Mumbai
View GitHub Profile
@sid24rane
sid24rane / Codechef.java
Created Feb 4, 2017
Strassen Matrix Multiplication in Java - NxN matrix
View Codechef.java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Codechef {
private static int[][] StrassenMultiply(int[][] A, int[][] B) {
int n = A.length;
@sid24rane
sid24rane / Multithreading.java
Created Sep 28, 2016
Searching and sorting algorithms operations - Mutithreading in Java
View Multithreading.java
package Multithreading;
import java.util.Scanner;
class MyThread extends Thread{
private int[] arr;
MyThread(int[] arr){
this.arr = arr;
@sid24rane
sid24rane / StackBalancedParenthesis.c
Created Sep 28, 2016
Balanced Parenthesis in C using stack
View StackBalancedParenthesis.c
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#define MAX_SIZE 100
struct Stack{
int top;
char arr[MAX_SIZE];
} st;
@sid24rane
sid24rane / base64-encode-decode.js
Created Jul 26, 2016
Node.js Base64 Encode Decode -> Image
View base64-encode-decode.js
var buffer = require('buffer');
var path = require('path');
var fs = require('fs');
function encode_base64(filename){
fs.readFile(path.join(__dirname,'/public/',filename),function(error,data){
if(error){
throw error;
}else{
var buf = Buffer.from(data);
@sid24rane
sid24rane / net.js
Last active Sep 30, 2021
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
View net.js
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});
@sid24rane
sid24rane / udp.js
Created Jul 25, 2016
Simple UDP Client and Server in Node.js ==> ( Echo Server )
View udp.js
var udp = require('dgram');
// --------------------creating a udp server --------------------
// creating a udp server
var server = udp.createSocket('udp4');
// emits when any error occurs
server.on('error',function(error){
console.log('Error: ' + error);
@sid24rane
sid24rane / websqlcrud.js
Created May 31, 2016
Web SQL Database Basic CRUD ( Create,Read,Update,Delete ) operation implementation!
View websqlcrud.js
function createDb() {
var db_name = 'jabber';
var db_version = '1.0';
var db_describe = 'Bro,its jabber';
var db_size = 2048;
var db = openDatabase(db_name, db_version, db_describe, db_size, function(db) {
console.log(db);
console.log("Database opened Successfully! Or created for the first time !");
createTable(db);
});
@sid24rane
sid24rane / ceasar_cipher.js
Created May 14, 2016
Simple Implementation of Ceasar cipher in JS (In 5min)
View ceasar_cipher.js
function ceaser_cipher(){
this.alphabets=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
}
ceaser_cipher.prototype.encrypt=function(s,n){
var plain_text=[...s];
for(var i = 0, length1 = plain_text.length; i < length1; i++){
plain_text[i]=this.alphabets[this.alphabets.indexOf(plain_text[i])+n];
}
return plain_text.toString();
@sid24rane
sid24rane / cssreset.css
Created May 14, 2016
Improved version of CSS Reset using CSS3 box-sizing properties and allows easy setting of font-size and responsive Images.
View cssreset.css
*,*::after,*::before
{
margin: 0;
padding: 0;
outline: none;
border: 0; vertical-align: baseline;
-webkit-box-sizing:inherit;
-moz-box-sizing: inherit;
-o-box-sizing: inherit;
box-sizing: inherit;