Skip to content

Instantly share code, notes, and snippets.

View Subhojit1992's full-sized avatar
🧿
Protected

Subhojit Subhojit1992

🧿
Protected
  • Capital Numbers Infotech
  • Kolkata, West-Bengal, India
  • 08:11 (UTC -12:00)
View GitHub Profile
@Subhojit1992
Subhojit1992 / App.js
Created July 26, 2020 07:20
React native run website as app with back button press to go back previous URL
import React from 'react';
import { WebView } from 'react-native-webview';
import {
View,
BackHandler,
Platform,
StyleSheet,
StatusBar,
} from 'react-native';
@Subhojit1992
Subhojit1992 / bash_profile.md
Created September 9, 2018 06:49 — forked from ankurk91/bash_profile.md
:octocat: Git branch name in Linux/Mac Terminal

Mac OS : Show your git branch name on your terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@Subhojit1992
Subhojit1992 / browser.html
Created February 22, 2018 07:10 — forked from stajnert/browser.html
Javascript to find browser version, os version and os bit version
<html>
<body>
<script type="text/javascript">
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
@Subhojit1992
Subhojit1992 / es7-es8-features.md
Last active January 14, 2018 10:27
es7-es8-features

String.prototype.padStart/padEnd

// padStart(desiredLength, textToPrepend)

// No text
''.padStart(10, 'Hi') // 'HiHiHiHiHi'

// Some text
'def'.padStart(6, 'abc') // 'abcdef'
@Subhojit1992
Subhojit1992 / _decimal.scss
Created July 20, 2017 04:52 — forked from terkel/_decimal.scss
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
@Subhojit1992
Subhojit1992 / 0_reuse_code.js
Created March 11, 2017 06:31
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console