Skip to content

Instantly share code, notes, and snippets.

View DenisGorbachev's full-sized avatar

Denis Gorbachev DenisGorbachev

View GitHub Profile
@DenisGorbachev
DenisGorbachev / .mongorc.js
Last active August 22, 2019 12:55
~/.mongorc.js
RegExp.escape = function(s) {
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
};
DBCollection.prototype.findOld = DBCollection.prototype.find;
DBCollection.prototype.find = function(query, fields) {
if (typeof query === 'string') {
var re = new RegExp(RegExp.escape(query), "i");
query = {$or: [{_id: re}, {name: re}, {title: re}, {text: re}, {"emails.address": re}]};
}
<application>
<component name="XDebuggerSettings">
<data-views />
<general />
<debuggers>
<debugger id="elixir">
<configuration>
<module-filters>
<list>
<module-filter pattern="Access" />
starfall@nx:~$ ping beingremarkable.me
PING beingremarkable.me (65.39.205.61) 56(84) bytes of data.
^C
--- beingremarkable.me ping statistics ---
32 packets transmitted, 0 received, 100% packet loss, time 31231ms
@DenisGorbachev
DenisGorbachev / GroupedDocumentChoiceList
Created June 9, 2012 10:57
GroupedDocumentChoiceList
<?php
namespace FasterThanWind\Bundle\TaskBundle\Form\ChoiceList;
use Symfony\Bundle\DoctrineMongoDBBundle\Form\ChoiceList\DocumentChoiceList as DocumentChoiceList;
use Symfony\Component\Form\Util\PropertyPath;
use Doctrine\ODM\MongoDB\DocumentManager;
/**
* Allows to choose from a list of documents, optionally grouped by a certain property (triggers the use of <optgroup> in template)
@DenisGorbachev
DenisGorbachev / PM2
Created August 2, 2015 11:17
PM2 test output
starfall@nx:~/workspace/PM2$ bash test/bash/watch.sh
$pm2 kill
[PM2] Stopping PM2...
[PM2] deleteProcessId process id 0
[PM2][WARN] No process found
[PM2] All processes have been stopped and deleted
[PM2] PM2 stopped
# Determine wget / curl
var _ = require("underscore");
_.mixin(require("underscore.deep"));
var config = function(local, wallaby) {
process.env.NODE_PATH += ":" + require('path').join(wallaby.localProjectDir, 'core', 'node_modules');
return _.deepExtend({
testFramework: "mocha",
files: [
"!test/**/*Spec.coffee",
"**/helper/**/*.coffee",
{
"swf": {
"accessKeyId": "-",
"secretAccessKey": "-",
"region": "us-east-1"
},
"logger": {
"sanitizedProperties": ["credentials", "accessToken", "refreshToken"],
"transports": {
"Loggly": {
@DenisGorbachev
DenisGorbachev / gist:b0cc8764fb1bcd4e97d7
Created July 16, 2015 16:50
Wallaby console output
wallaby.js started
core v1.0.80
Thu, 16 Jul 2015 16:49:21 GMT wallaby:project File cache: /home/starfall/.WebStorm10/system/wallaby/projects/f3e4c4010717eb1a
Thu, 16 Jul 2015 16:49:21 GMT wallaby:workers Parallelism for initial run: 4, for regular run: 2
Thu, 16 Jul 2015 16:49:21 GMT wallaby:workers Starting run worker instance #0
Thu, 16 Jul 2015 16:49:21 GMT wallaby:workers Starting run worker instance #1
Thu, 16 Jul 2015 16:49:21 GMT wallaby:workers Starting run worker instance #2
Thu, 16 Jul 2015 16:49:21 GMT wallaby:workers Starting run worker instance #3
Thu, 16 Jul 2015 16:49:21 GMT wallaby:workers Web server is listening at 35019
Thu, 16 Jul 2015 16:49:21 GMT wallaby:project No instrumented file lib/Binding.coffee, re-instrumenting original file
@DenisGorbachev
DenisGorbachev / The Addonwave Contributor Agreement Version 1.0
Last active August 29, 2015 14:25
The Addonwave Contributor Agreement Version 1.0
The Addonwave Contributor Agreement Version 1.0
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Addonwave, as represented by Denis Gorbachev. Except for the license granted herein to Addonwave and recipients of software distributed by Addonwave, You reserve all right, title, and interest in and to Your Contributions.
Definitions.
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Addonwave. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership
@DenisGorbachev
DenisGorbachev / autopackage.js
Last active August 29, 2015 14:20
autopackage.js
var fs = Npm.require("fs");
var path = Npm.require("path");
getDefaultProfiles = function() {
return [
{
path: "lib/compatibility",
architecture: ["client", "server"]
},{
path: "client/compatibility",