Skip to content

Instantly share code, notes, and snippets.

gabouh / .gitignore
Created Jan 6, 2019 — forked from madzak/.gitignore
Sample Application using Module, Facade, and Mediator Patterns
gabouh /
Created Dec 30, 2018 — forked from jimothyGator/
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
gabouh /
Created Dec 28, 2018 — forked from alexgorbatchev/
Generate self signed https certificates for node.js express/hapi/etc
openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem
gabouh / export-chrome-bookmarks.js
Created Nov 26, 2018 — forked from bgrins/export-chrome-bookmarks.js
Reminder of how to export bookmarks from Chrome as text.
View export-chrome-bookmarks.js
Export bookmarks from Chrome as text.
Go to Bookmarks Manager->Organize->Export to HTML file.
Then open that file, open console and run this command:
[]"dt a"), function(a) {
return a.textContent + " - " + a.href

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.


The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

View import_json_appsscript.js
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
gabouh / retrieve-indexeddb-file-create-object-url.js
Created May 28, 2018 — forked from robnyman/retrieve-indexeddb-file-create-object-url.js
Retrieve stored file from IndexedDB and create an ObjectURL
View retrieve-indexeddb-file-create-object-url.js
// Retrieve the file that was just stored
transaction.objectStore("elephants").get("image").onsuccess = function (event) {
var imgFile =;
console.log("Got elephant!" + imgFile);
// Get window.URL object
var URL = window.URL || window.webkitURL;
// Create and revoke ObjectURL
var imgURL = URL.createObjectURL(imgFile);
gabouh / IndexedDB-storing-and-retrieving-files.js
Created May 6, 2018 — forked from tantaman/IndexedDB-storing-and-retrieving-files.js
Download an image, save it to IndexedDB, read it out, display the image via createObjectURL - works in Chrome and Firefox. Based on but with fixes made for Chrome.
View IndexedDB-storing-and-retrieving-files.js
(function () {
// IndexedDB
function BrowserType() {
var n = navigator.appName;
var ua = navigator.userAgent;
var tem;
var m = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
if (m && (tem = ua.match(/version\/([\.\d]+)/i)) != null) m[2] = tem[1];
m = m ? [m[1], m[2]] : [n, navigator.appVersion, '-?'];
gabouh / PoorMansCodeEditor.html
Created Feb 26, 2018 — forked from deanebarker/PoorMansCodeEditor.html
Poor man's code editor in pure JavaScript.
View PoorMansCodeEditor.html
This is a textarea that:
(1) Is styled(-ish) like a code editor
(2) Catches tabs and converts them to four (4) spaces
(3) Duplicates leading spaces from the last line
(4) Auto-expands to input
Pure inline HTML and JavaScript. No external dependencies. Has issues pre-IE-8, but should be otherwise okay.
gabouh /
Created Oct 11, 2017 — forked from 0x00dec0de/
Fix user permissions to vesta control panel
cd /home/
for i in `ls | grep -v 'lost+found'`; do
if id "$i" &>/dev/null ; then
chattr -i /home/$i/conf
chown -R ${i}:${i} $i
chown root:root /home/$i/conf
chown root:root /home/$i/conf/*
chown root:bind /home/$i/conf/dns/* &>/dev/null
chown Debian-exim:mail /home/$i/conf/mail/* &>/dev/null