Skip to content

Instantly share code, notes, and snippets.

View BalasubramaniM's full-sized avatar
🎯
Focusing

Balasubramani M BalasubramaniM

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am balasubramanim on github.
  • I am balasubramanim (https://keybase.io/balasubramanim) on keybase.
  • I have a public key ASDqeMtllgOPTgQwAp8CjmD5XNCE4eCViG09M-rgwsnXigo

To claim this, I am signing this object:

@BalasubramaniM
BalasubramaniM / array_chunk.js
Created August 19, 2021 01:00
Chunk array by given size.
function chunk(arr, chunkSize) {
let result = [];
function getChunkedArr(arrToChunk) {
let res = [];
for(let i = 0; i < arrToChunk.length; i++) {
res.push(arrToChunk[i]);
}
return res;
}
@BalasubramaniM
BalasubramaniM / polyfill_for_array_flat.js
Last active August 17, 2021 15:56
Array Flat Polyfill with Depth Implementation
Array.prototype.myFlat = function (depth) {
function getFlattenedArr(arr) {
let res = [];
let isSpreaded = false;
for (let value of arr) {
if (Array.isArray(value)) {
isSpreaded = true;
res.push(...value);
} else {
res.push(value);
@BalasubramaniM
BalasubramaniM / App.js
Created January 28, 2019 07:48 — forked from andrewluetgers/App.js
Image loading with react-konva
import React, { Component } from 'react';
import DevTools from 'mobx-react-devtools';
import Konva from 'konva';
import {Stage, Layer, Rect, Line, Image} from 'react-konva';
import Img from './Img/Img.js';
import './App.css';
import pg from '../assets/scribo-doc-dia-00008061.json'
console.log(pg);
@BalasubramaniM
BalasubramaniM / tn_education.json
Last active November 10, 2018 12:45
Physical infrastructure facilities in Municipality and Corporation schools in Tamil Nadu.
This file has been truncated, but you can view the full file.
{
"data": [
{
"s_no": "1",
"district": "Thiruvallur",
"village_panchayat": "Thiruvallur",
"school_name": "MUNICIPAL MIDDLE SCHOOL",
"school_id": "33010105701",
"category_of_school": "Secondary School",
"yearof_establishment": "1940",
@BalasubramaniM
BalasubramaniM / media-query.css
Created October 25, 2018 15:10 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@BalasubramaniM
BalasubramaniM / movies.json
Created October 16, 2018 12:38
Movies List and it's meta.
[
{
"movie_title": "Avatar ",
"director_name": "James Cameron",
"actor_1_name": "CCH Pounder",
"actor_2_name": "Joel David Moore",
"genres": "Action|Adventure|Fantasy|Sci-Fi",
"language": "English",
"country": "USA",
"content_rating": "PG-13",
@BalasubramaniM
BalasubramaniM / moviesmeta.json
Last active October 16, 2018 12:36
List of movies and it's metadata JSON.
[
{
"movie_title": "Avatar ",
"director_name": "James Cameron",
"actor_1_name": "CCH Pounder",
"actor_2_name": "Joel David Moore",
"genres": "Action|Adventure|Fantasy|Sci-Fi",
"language": "English",
"country": "USA",
"content_rating": "PG-13",
@BalasubramaniM
BalasubramaniM / hashtable.js
Last active October 2, 2018 08:16
Data Structures: Create a Hash Table - freeCodeCamp
var called = 0;
var hash = string => {
called++;
var hash = 0;
for (var i = 0; i < string.length; i++) {
hash += string.charCodeAt(i);
}
return hash;
};
var HashTable = function() {
@BalasubramaniM
BalasubramaniM / quotes.json
Last active October 10, 2018 08:56
Random Quotes
{
"quotes": [
{
"quote": "Life isn’t about getting and having, it’s about giving and being.",
"author": "Kevin Kruse",
"url": "life-isnt-about-getting-and-having-its-about-giving-and-being"
},
{
"quote": "Whatever the mind of man can conceive and believe, it can achieve.",
"author": "Napoleon Hill",