Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
༼ つ◕_◕ ༽つ

Anatoly Pashin b1rdex

🚀
༼ つ◕_◕ ༽つ
  • Vladivostok, Russia
View GitHub Profile
View ma-test.mq4
#property copyright ""
#property link ""
#property description "moving averages"
#define MAGICMA 123123123
input double MaximumRisk = 0.02; // maximum risk (% of depo)
input bool willYouTradeBuyHands = false; // if true, I'll check every opened order for creator (possible slowing?)
@b1rdex
b1rdex / is-focused.js
Created Feb 25, 2014
node-webkit window.isFocused emulation
View is-focused.js
(function() {
window.frame = require("nw.gui").Window.get();
window.frame.isFocused = true;
var windowFocusHandler = function() {
window.frame.isFocused = true;
}
, windowBlurHandler = function() {
window.frame.isFocused = false;
@b1rdex
b1rdex / breadcrumbsFilter.class.php
Created Apr 3, 2014
symfony1 breadcrumbs builder based on filter
View breadcrumbsFilter.class.php
<?php
class breadcrumbsFilter extends sfFilter
{
public function execute($filterChain)
{
if ($this->isFirstCall()) {
$module = $this->context->getRequest()->getParameter("module");
$action = $this->context->getRequest()->getParameter("action");
@b1rdex
b1rdex / sfWidgetFormSchemaFormatterBootstrap.class.php
Created Apr 14, 2012 — forked from aledujke/sfWidgetFormSchemaFormatterBootstrap.class.php
Symfony form formatter to use with Twitter Bootstrap v2.0 CSS
View sfWidgetFormSchemaFormatterBootstrap.class.php
<?php
class sfWidgetFormSchemaFormatterBootstrap extends sfWidgetFormSchemaFormatter
{
protected
$rowFormat = "<div class=\"control-group %row_class%\">\n %label%\n <div class=\"controls\">\n %field%\n %error%\n %help%\n %hidden_fields%\n </div>\n</div>\n",
$errorRowFormat = '%errors%',
$errorListFormatInARow = "<span class=\"help-inline\">%errors%</span>\n",
$errorRowFormatInARow = "%error% ",
$namedErrorRowFormatInARow = "%name%: %error% ",
$helpFormat = '<p class="help-block">%help%</p>',
@b1rdex
b1rdex / gist:2699921
Created May 15, 2012
Print cart for ulmart.ru shop
View gist:2699921
//Dear Razrabs, please add this fucking feature to your site.
;(function() {
var artids = $('.artid'),
names = $('.clName a'),
counts = $('.clCount input'),
prices = $('.clPrice'),
costs = $('.clCost'),
r = []
;
@b1rdex
b1rdex / gist:5624325
Created May 22, 2013
hoa math condition functions
View gist:5624325
// defining hoa functions
'if' => xcallable(function($condition, $than, $else) {
return $condition ? $than : $else;
}),
'lt' => xcallable(function($left, $right) {
return $left < $right;
}),
'gt' => xcallable(function($left, $right) {
return $left > $right;
}),
@b1rdex
b1rdex / gist:5624332
Created May 22, 2013
support for exprlib syntax for formulate
View gist:5624332
static public function build($formula, $isCalculable = self::CALCULABLE)
{
return new Formula($formula, $isCalculable);
}
public function setVars(array $vars)
{
$this->parameterBag->datas = array_merge($this->parameterBag->datas, $vars);
return $this;
@b1rdex
b1rdex / main.js
Last active Dec 27, 2015
node-webkit cut/copy/paste context menu example
View main.js
// script moved to http://github.com/b1rdex/nw-contextmenu