Skip to content

Instantly share code, notes, and snippets.

View dipaktelangre's full-sized avatar

Dipak Telangre dipaktelangre

  • Coditas
  • Pune
View GitHub Profile
@dipaktelangre
dipaktelangre / show-indexes.js
Created December 10, 2018 11:13 — forked from wpottier/show-indexes.js
MongoDB copy indexes
db.getCollectionNames().forEach(function(collection) {
indexes = db[collection].getIndexes();
indexes.forEach(function (c) {
opt = '';
ixkey = JSON.stringify(c.key, null, 1).replace(/(\r\n|\n|\r)/gm,"");
ns = c.ns.substr(c.ns.indexOf(".") + 1, c.ns.length);
for (var key in c) {
if (key != 'key' && key != 'ns' && key != 'v') {
if (opt != '') { opt+= ','}
if (c.hasOwnProperty(key)) {

Prefix all commands with Ctrl-b

Command                                 Action

c	                      Create a new window
n	                      Change to next window
p	                      Change to previous window
"	                      Split pane horizontally
%	                      Split pane vertically
,	                      Rename current window
o	                      Move to next pane
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
# Find files which contains the "everybody wants me" text
#
# grep -H "everybody wants me" some/dir -R | cut -d: -f1
#
# it will print matching file names
#
# so what if we create handy command for it as:
#
grep -H $0 $1 -R cut -d: -f1