Skip to content

Instantly share code, notes, and snippets.

View OlivierJM's full-sized avatar

ojm OlivierJM

View GitHub Profile
@OlivierJM
OlivierJM / gist:2d096363f93f8d2097f0e47c2dff126b
Created April 23, 2018 06:26 — forked from stewartduffy/gist:481f21ea4906e611d934
Regex to remove file extension from JS string.
var filenameFull = "tm_icons.png";
//Regex to remove
var filenameText = filenameFull.replace(/\.[^/.]+$/, "");
@OlivierJM
OlivierJM / mongoexport-all-collections-as-json.sh
Created September 27, 2017 09:04 — forked from thbkrkr/mongoexport-all-collections-as-json.sh
Export all MongoDB collections to JSON
#!/bin/bash
DB=$1
COLLECTIONS=$(mongo localhost:27017/$DB --quiet --eval "db.getCollectionNames()" | sed 's/,/ /g')
for collection in $COLLECTIONS; do
echo "Exporting $DB/$collection ..."
mongoexport -d newtickettoolDB -c $collection -o $collection.json
done
@OlivierJM
OlivierJM / adb+
Created April 3, 2017 08:45 — forked from ryanamaral/adb+
#!/bin/bash
# Script adb+
# Usage
# You can run any command adb provides on all your currently connected devices
# ./adb+ <command> is the equivalent of ./adb -s <serial number> <command>
#
# Examples
# ./adb+ version
# ./adb+ install apidemo.apk
# ./adb+ uninstall com.example.android.apis