This file contains 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
//+------------------------------------------------------------------+ | |
//| Powers EA | | |
//| Copyright 2020, PowersEA | | |
//| http://www.uchepowers.com | | |
//+------------------------------------------------------------------+ | |
#include <Trade/Trade.mqh> | |
CTrade trade; | |
int rsiHandle; |
This file contains 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
public static function curlPost($arr, $url, $type) { | |
$curl = curl_init(); | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => $url, | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, |
This file contains 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
public static function time_elapsed_string($datetime, $full = false, $msgFuture = "to go", $msgPresent = " just now", $msgPast = " ago") { | |
if (isset($datetime)) { | |
$now = new \DateTime; | |
$date = new \DateTime($datetime); | |
$diff = $now->diff($date); | |
$datePosition = " ago"; | |
if ($now < $date) { | |
$datePosition = $msgFuture; | |
} |
This file contains 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
public static function firstDayOf($period, \DateTime $date = null) { | |
$period = strtolower($period); | |
$validPeriods = array('year', 'quarter', 'month', 'week'); | |
if (!in_array($period, $validPeriods)) | |
throw new \InvalidArgumentException('Period must be one of: ' . implode(', ', $validPeriods)); | |
$newDate = ($date === null) ? new \DateTime() : clone $date; | |
switch ($period) { |
This file contains 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 | |
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
namespace app\assets; |
This file contains 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
Versioning The Chaos | |
You may find yourself in a company or team where new features are released as hotfixes,A Team where Alpha & Beta are one and the same, in this kind of environment the end users become the testers of your application. | |
You are not alone! A lot of software engineers have found themselves stuck in such situation. Some left for a more organized company, others endured till the end, while some found a way to manage the situation by versioning. | |
Why versioning? | |
My answer is that it gives your brain the chance to pace itself. Studies have shown that writing out your tasks helps eliminate stress and makes people more organized & focused on accomplishing their tasks. | |
Let me use a real scenario to illustrate how versioning can combat chaos. |