Skip to content

Instantly share code, notes, and snippets.

View Mukesh23singh's full-sized avatar

Mukesh Singh Mukesh23singh

  • Citiustech healthcare technology private limited
  • Mumbai
View GitHub Profile
@Mukesh23singh
Mukesh23singh / db.js
Created October 1, 2020 03:19 — forked from skyerus/db.js
indexeddb
let dbInstance
module.exports = {
getDB() {
if (!dbInstance) {
dbInstance = new Promise((resolve, reject) => {
const openreq = indexedDB.open('picker-db', 2)
openreq.onerror = () => {
reject(openreq.error)
@Mukesh23singh
Mukesh23singh / indexed-db-helpers.js
Created October 1, 2020 03:19 — forked from KhalilZaidoun/indexed-db-helpers.js
indexed-db helpers methods
import indexedDB from './indexedDB'
if (!indexedDB) {
// console.log("Your browser does not support a stable version of IndexedDB. Some features will not be available.")
}
const DATABASE_NAME = 'db_name';
const READ_WRITE_PERMISSION = 'readwrite';
/**
* From the W3C working draft
* http://www.w3.org/TR/IndexedDB
*/
// synchronously set properties on a database and retrieve a record
var db = indexedDB.open('books', 'Book store', false);
if (db.version !== '1.0') {
var olddb = indexedDB.open('books', 'Book store');
@Mukesh23singh
Mukesh23singh / IndexedDB.js
Created October 1, 2020 03:12 — forked from ParkMinKyu/IndexedDB.js
IndexedDB plugin
/*!
* indexedDB Plugin v0.0.1
* License: https://github.com/ParkMinKyu/diary/blob/master/LICENSE
* (c) 2017 niee
*/
var IndexedDB = {
indexedDB: window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB,
schemaName: null,
dataBaseName: null,
checkDB: function () {

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Mukesh23singh
Mukesh23singh / tmux.md
Created June 2, 2020 21:43 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

Common Apache Commands and Features

Commands

Checks Syntax of Configuration Files

apachectl -t

Lists Loaded modules

Apache Cheat Sheet
Setup a Virtual Domain
NameVirtualHost *
<VirtualHost *>
DocumentRoot /web/example.com/www
ServerName www.example.com
ServerAlias example.com
CustomLog /web/example.com/logs/access.log combined
; cli configs
long = true
registry = "https://registry.npmjs.org/"
; userconfig /home/gabriel/.npmrc
prefix = "/home/gabriel/.npm"
; default values
always-auth = false
bin-links = true
@Mukesh23singh
Mukesh23singh / stress.sh
Created April 26, 2020 16:50 — forked from mikepfeiffer/stress.sh
Install Stress Utility on Amazon Linux 2
sudo amazon-linux-extras install epel -y
sudo yum install stress -y