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
function pt | |
gittower $argv | |
open -a PhpStorm $argv | |
end |
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
$groups = Groups::all(); | |
$arr = []; | |
foreach ($groups as $group) { | |
$item = $group->toArray(); | |
$item['active_bets'] = $group->bets()->active()->count(); // går ud fra du har lavet et eloquent scope der hedder active | |
$arr[] = $item; | |
} | |
return response()->json($arr); |
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
<pre> | |
<?php | |
// remember to rename the file to a random string to prevent abuse | |
system('cd .. && git pull && composer install && php artisan migrate --force'); |
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
### Keybase proof | |
I hereby claim: | |
* I am alysdal on github. | |
* I am andreaslysdal (https://keybase.io/andreaslysdal) on keybase. | |
* I have a public key whose fingerprint is 13FB 64FD F4E1 9148 3BB2 9CDC 9C13 D3A2 56E8 E21E | |
To claim this, I am signing this object: |
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 | |
// device info | |
$deviceID = "390024001347343338333633"; | |
$accessToken = "fa2405080d01b918e0574a0f23a0b06c64332305"; | |
$command = "setcolor"; | |
// api url | |
$url = "https://api.particle.io/v1/devices/".$deviceID."/".$command."?access_token=".$accessToken; |
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 | |
// database credentials | |
$dbHost = 'localhost'; | |
$dbName = 'webworkshop'; | |
$dbUser = 'root'; | |
$dbPass = 'root'; | |
try { | |
// attempt to connect to the database | |
$db = new PDO('mysql:host=' . $dbHost . ';dbname=' . $dbName . ';charset=UTF8', $dbUser, $dbPass); |
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 | |
// database credentials | |
$dbHost = 'localhost'; | |
$dbName = 'webworkshop'; | |
$dbUser = 'root'; | |
$dbPass = ''; | |
try { | |
// attempt to connect to the database | |
$db = new PDO('mysql:host=' . $dbHost . ';dbname=' . $dbName . ';charset=UTF8', $dbUser, $dbPass); |