This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function curry(fn) { | |
| let i = 0; | |
| let countedArg = 0; | |
| let method = function(arg) { | |
| return arg; | |
| }; | |
| let args = []; | |
| while(i< fn.length) { | |
| method = (function(fun) { | |
| return function(...params) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
| ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint" | |
| if [[ "$STAGED_FILES" = "" ]]; then | |
| exit 0 | |
| fi | |
| PASS=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const message = 'Amar nam {{name}}, amar boyos {{age}}, and {{name}} er first letter R'; | |
| function render(text, values) { | |
| let str = text; | |
| Object.keys(values).forEach(key => { | |
| str = str.replace(new RegExp(`{{${key}}}`, 'g'), values[key]); | |
| }); | |
| return str; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var students = [ | |
| { | |
| firstName: 'Rahul', | |
| lastName: 'Baruri', | |
| marks: 809, | |
| group: 'science' | |
| }, | |
| { | |
| firstName: 'Ripan', | |
| lastName: 'Baruri', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var holidays = []; | |
| $(document).ready(function () { | |
| $(".list-table").find("tbody").find("tr").each(function (index, item) { | |
| var holiday = {}; | |
| $(item).find("td").each(function (indx, colunm) { | |
| if (indx == 1) { | |
| var timeTag = $(colunm).find("time"); | |
| var timeStamp; | |
| var dateText; | |
| if (timeTag.length) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function toBengaliNumber(number) { | |
| var numbers = { | |
| '1': '১', | |
| '2': '২', | |
| '3': '৩', | |
| '4': '৪', | |
| '5': '৫', | |
| '6': '৬', | |
| '7': '৭', | |
| '8': '৮', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object.prototype.oloo = function(o1, o2){ | |
| if( o1 && o2 && typeof o1 === "object" && typeof o2 === "object"){ | |
| // create new object | |
| var o0 = Object.create(o1); | |
| // copy all props to the brand new obj | |
| for( var key in o2 ){ | |
| if(o2.hasOwnProperty(key)){ | |
| o0[key] = o2[key]; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var EventDispatcher= function() { | |
| this.events = {}; | |
| } | |
| EventDispatcher.prototype.add = function(name, handler) { | |
| if(!(name in this.events)) { | |
| this.events[name] = [handler]; | |
| } else { | |
| this.events[name].push(handler); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fetch = require("node-fetch"); | |
| const fs = require('fs'); | |
| function getAllRepos() { | |
| return fetch('https://api.github.com/users/rbrahul/repos'); | |
| } | |
| function getRepoInfo(repoName) { | |
| return fetch(`https://api.github.com/repos/rbrahul/${repoName}`); | |
| } |