This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var collections = db.getCollectionNames(); | |
| for(var i = 0; i < collections.length; i++){ | |
| var name = collections[i]; | |
| if(name.substr(0, 6) != 'system'){ | |
| var c = db.getCollection(name).count() ; | |
| if (c > 1000) print(name + ' - ' + c + ' records'); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm init; | |
| ls node_modules/ |xargs npm install --save |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \begin{equation} | |
| P^+=\[ \left( \begin{array}{ccc} | |
| 1 & 0\\ | |
| 0 & 0\end{array} \right)\] | |
| P^-=\[ \left( \begin{array}{ccc} | |
| 0 & 0\\ | |
| 0 & 1\end{array} \right)\] | |
| \end{equation} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Some things taken from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # Set the colours you can use | |
| black='\033[0;30m' | |
| white='\033[0;37m' | |
| red='\033[0;31m' | |
| green='\033[0;32m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Relational DB ⇒ Databases ⇒ Tables ⇒ Rows ⇒ Columns | |
| Elasticsearch ⇒ Indices ⇒ Types ⇒ Documents ⇒ Fields |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use DebugBar\StandardDebugBar; | |
| $debugbar = new StandardDebugBar(); | |
| $debugbarRenderer = $debugbar->getJavascriptRenderer(); | |
| $debugbar["messages"]->addMessage("hello world!"); | |
| ?> | |
| <html> | |
| <head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $file = 'log.txt'; | |
| // Open the file to get existing content | |
| $current = file_get_contents($file); | |
| // Append a new person to the file | |
| $current .= "I did it!\n"; | |
| // Write the contents back to the file | |
| file_put_contents($file, $current); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $countries = array | |
| ( | |
| 'AF' => 'Afghanistan', | |
| 'AX' => 'Aland Islands', | |
| 'AL' => 'Albania', | |
| 'DZ' => 'Algeria', | |
| 'AS' => 'American Samoa', | |
| 'AD' => 'Andorra', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function pad (n, width, z) { | |
| z = z || '0'; | |
| n = n + ''; | |
| while (n.length < width) { n = z + n; } | |
| return n; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |