Skip to content

Instantly share code, notes, and snippets.

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@ayoubkalilcds
ayoubkalilcds / detect-mobile-browser.js
Created November 14, 2019 07:51 — forked from niksmac/detect-mobile-browser.js
Nodejs Express code to redirect mobile user agets
var express = require('express'),
app = express();
app.listen(80);
app.get('/', function(req, res){
var ua = req.header('user-agent');
// Check the user-agent string to identyfy the device.
if(/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile|ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua)) {
res.sendfile(__dirname + '/mobile.html');
} else {
res.sendfile(__dirname + '/index.html');
@ayoubkalilcds
ayoubkalilcds / detect-mobile-browser.js
Created November 14, 2019 07:51 — forked from niksmac/detect-mobile-browser.js
Nodejs Express code to redirect mobile user agets
var express = require('express'),
app = express();
app.listen(80);
app.get('/', function(req, res){
var ua = req.header('user-agent');
// Check the user-agent string to identyfy the device.
if(/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile|ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua)) {
res.sendfile(__dirname + '/mobile.html');
} else {
res.sendfile(__dirname + '/index.html');
@ayoubkalilcds
ayoubkalilcds / detect-mobile-browser.js
Created November 14, 2019 07:51 — forked from niksmac/detect-mobile-browser.js
Nodejs Express code to redirect mobile user agets
var express = require('express'),
app = express();
app.listen(80);
app.get('/', function(req, res){
var ua = req.header('user-agent');
// Check the user-agent string to identyfy the device.
if(/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile|ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua)) {
res.sendfile(__dirname + '/mobile.html');
} else {
res.sendfile(__dirname + '/index.html');
@ayoubkalilcds
ayoubkalilcds / detect-mobile-browser.js
Created November 14, 2019 07:51 — forked from niksmac/detect-mobile-browser.js
Nodejs Express code to redirect mobile user agets
var express = require('express'),
app = express();
app.listen(80);
app.get('/', function(req, res){
var ua = req.header('user-agent');
// Check the user-agent string to identyfy the device.
if(/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile|ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua)) {
res.sendfile(__dirname + '/mobile.html');
} else {
res.sendfile(__dirname + '/index.html');
@ayoubkalilcds
ayoubkalilcds / detect-mobile-browser.js
Created November 14, 2019 07:51 — forked from niksmac/detect-mobile-browser.js
Nodejs Express code to redirect mobile user agets
var express = require('express'),
app = express();
app.listen(80);
app.get('/', function(req, res){
var ua = req.header('user-agent');
// Check the user-agent string to identyfy the device.
if(/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile|ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua)) {
res.sendfile(__dirname + '/mobile.html');
} else {
res.sendfile(__dirname + '/index.html');
@ayoubkalilcds
ayoubkalilcds / detect-mobile-browser.js
Created November 14, 2019 07:51 — forked from niksmac/detect-mobile-browser.js
Nodejs Express code to redirect mobile user agets
var express = require('express'),
app = express();
app.listen(80);
app.get('/', function(req, res){
var ua = req.header('user-agent');
// Check the user-agent string to identyfy the device.
if(/mobile|iphone|ipod|android|blackberry|opera|mini|windows\sce|palm|smartphone|iemobile|ipad|android|android 3.0|xoom|sch-i800|playbook|tablet|kindle/i.test(ua)) {
res.sendfile(__dirname + '/mobile.html');
} else {
res.sendfile(__dirname + '/index.html');
@ayoubkalilcds
ayoubkalilcds / cloudSettings
Created April 5, 2019 09:36
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-01-30T07:57:00.805Z","extensionVersion":"v2.8.7"}
@ayoubkalilcds
ayoubkalilcds / cloudSettings
Last active November 11, 2021 04:23 — forked from caedes/cloudSettings
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-11-11T04:23:45.887Z","extensionVersion":"v3.4.3"}