Chart Download
How to download technical analysing charts of a stock, index or currency exchange.
Start http://chart.finance.yahoo.com/z?
ID
<?php | |
class CalculatorTest extends TestCase | |
{ | |
/** @test */ | |
public function it_adds_two_numbers() | |
{ | |
$calculator = new Calculator(); | |
$total = $calculator->sum(1, 2); | |
$this->assertSame(3, $total); |
<?php | |
$timeSeries = []; | |
// Using Carbon | |
$start = \Carbon\Carbon::create(1983, 9, 1, 0, 0, 0); | |
$end = \Carbon\Carbon::create(2050, 1, 1, 0, 0,0); | |
while ($start->format('Y-m-d') < $end->format('Y-m-d')) { | |
$start->addDay(); |
<?php | |
MyController extends Controller | |
{ | |
public function store(Request $request) | |
{ | |
$interaction = Interaction::create($this->pick((new Interaction)->getFillable(), $request); | |
} | |
/** |
<?php | |
try($attempts = 1, $wait = 0) { | |
// Try $attempts times to do something, waiting $wait milliseconds between trys | |
// Within the try block scope, we have access to the $attempts and $wait arguments | |
$this->log('Doing something important attempt: ' . $attempt); | |
} | |
catch (Exception $e) { | |
// Do something | |
} |
<?php | |
// Instead of using the following code | |
$builder = User::with('somerelationship'); | |
if ($request->has('order_by')) { | |
$builder->orderBy($request->input('order_by')); | |
} | |
$users = $builder->get(); |
<?php | |
$factory->define(App\User::class, function (Faker\Generator $faker) { | |
static $password; | |
return [ | |
'name' => $faker->name, | |
'email' => $faker->unique()->safeEmail, | |
'password' => $password ?: $password = bcrypt('secret'), | |
'remember_token' => str_random(10), |
<?php | |
return PhpCsFixer\Config::create() | |
->setRiskyAllowed(true) | |
->setRules([ | |
'@Symfony' => true, | |
'@Symfony:risky' => true, | |
'array_syntax' => ['syntax' => 'short'], | |
'combine_consecutive_unsets' => true, |
Chart Download
How to download technical analysing charts of a stock, index or currency exchange.
Start http://chart.finance.yahoo.com/z?
ID
From time to time, when running integration tests you'll notice that tests that worked previously have stopped working. Trying to modify the schema of an SQLite database is throwing an error. The dreaded:
Error (11) malformed database
Fortunately, there's quite an easy fix. Simply head to the command line, and use the following commands:
sqlite3 yourdatabase.sqlite
<?php | |
$balanceA=array( | |
"USD" => 10000, | |
"GBP" => 20000 | |
); | |
$balanceB=array( | |
"USD" => 10000, | |
"GBP" => 20000, | |
"JPY" => 100 |