Skip to content

Instantly share code, notes, and snippets.

View korsmakolnikov's full-sized avatar

Federico Caprari korsmakolnikov

View GitHub Profile
@korsmakolnikov
korsmakolnikov / rmButSomeFiles
Created May 27, 2016 12:25
Remove some files by name with exceptions by name
find . -iname 'app_*' ! -name 'app_e2e.php' ! -name 'app_dev*' -type f -exec rm -f {} +
@korsmakolnikov
korsmakolnikov / doctrineCoerenceFixer.js
Last active May 2, 2016 11:16
Fix all doctrine autoincrement index of an entire database
var collections = db.getCollectionNames();
//print(collections);
function isEmpty(obj) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop))
return false;
}
@korsmakolnikov
korsmakolnikov / mongoFieldNameScan.js
Last active April 29, 2016 16:54
Program to scan an entire mongo database for a certain fieldname (and check recursevely in embedded docs)
var collections = db.getCollectionNames();
//print(collections);
collections.forEach(function(col) {
function isEmpty(obj) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop))
return false;
@korsmakolnikov
korsmakolnikov / isEmpty.js
Created April 29, 2016 15:19
pre-ES5 function to check if an object is empty
function isEmpty(obj) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop))
return false;
}
return true;
}
@korsmakolnikov
korsmakolnikov / 0_reuse_code.js
Created April 29, 2016 15:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console