Skip to content

Instantly share code, notes, and snippets.

View iamsibasish's full-sized avatar
πŸ‘¨β€πŸ’»
Building Things

Sibasish Mohanty iamsibasish

πŸ‘¨β€πŸ’»
Building Things
View GitHub Profile
@iamsibasish
iamsibasish / generate-pushid.js
Created September 24, 2018 09:52 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@iamsibasish
iamsibasish / makeDbTable
Created August 16, 2018 13:25
Make A Table created by sibasishmohanty - https://repl.it/@sibasishmohanty/Make-A-Table
def pr(arr,k):
count_arr = []
for i in arr:
count_arr.append(numberOfDigits(i))
max_l = max(count_arr)
n = len(arr)
a= 1
b = 0
@iamsibasish
iamsibasish / main.py
Created August 16, 2018 13:24
Codeforce1003-A. Polycarp's Pockets created by sibasishmohanty - https://repl.it/@sibasishmohanty/Codeforce1003-A-Polycarps-Pockets
def solonA(arr):
count=1
dicc={}
for i in arr:
if i in dicc:
dicc[i]+=1
count=max(count,dicc[i])
else:
dicc[i]=1
print(count)
@iamsibasish
iamsibasish / Main.java
Created August 16, 2018 13:23
CSVParser created by sibasishmohanty - https://repl.it/@sibasishmohanty/CSVParser
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
// Source of file
@iamsibasish
iamsibasish / Main.java
Created August 16, 2018 13:23
CSVParser created by sibasishmohanty - https://repl.it/@sibasishmohanty/CSVParser
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
// Source of file
@iamsibasish
iamsibasish / gist:c39721556ac45ee12d0fe03492714080
Created March 8, 2018 11:28 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@Override
public void onSaveInstanceState(Bundle state){
super.onSaveInstanceState(state);
state.putParcelableArrayList("questionsArray", questions);
state.putParcelableArrayList("userAnswersArray", userAnswers);
state.putInt("position", position);
state.putInt("mSeconds", mSeconds);
state.putInt("mTestId", mTestId);
state.putParcelable("mTest", mTest);
}
@Override
public void onSaveInstanceState(Bundle state){
super.onSaveInstanceState(state);
state.putParcelableArrayList("questionsArray", questions);
state.putParcelableArrayList("userAnswersArray", userAnswers);
state.putInt("position", position);
state.putInt("mSeconds", mSeconds);
state.putInt("mTestId", mTestId);
state.putParcelable("mTest", mTest);
}
@iamsibasish
iamsibasish / ioslocaleidentifiers.csv
Created December 6, 2016 10:31 — forked from jacobbubu/ioslocaleidentifiers.csv
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)