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 | |
/* | |
$response->headers->all() = [ | |
'test' => ['test-value'], | |
'Content-Type' => ['application/json'], | |
]; | |
*/ | |
$found = false; | |
foreach ($response->headers->all() as $key => $value) { |
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
# In your ~/.bash_profile | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\033[1;33m⚡ ︎\033[0;32m\W\[\033[0;33m\]\$(parse_git_branch)\[\033[00m\] $ " |
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
/* Skompilowany program */ | |
javascript:(function()%7Bfunction%20copyThat(text)%20%7Bvar%20node%20%3D%20document.createElement('textarea')%3Bvar%20selection%20%3D%20document.getSelection()%3Bnode.textContent%20%3D%20text%3Bdocument.body.appendChild(node)%3Bselection.removeAllRanges()%3Bnode.select()%3Bdocument.execCommand('copy')%3Bselection.removeAllRanges()%3Bdocument.body.removeChild(node)%3B%7Dif(document.title%3D%3D%22CEIDG%22)%20%7Blet%20tdane%20%3D%20document.querySelectorAll('.search-data-label')%3Blet%20twart%20%3D%20document.querySelectorAll('.search-data-value')%3Bvar%20output%20%3D%20'CEIDG%3B'%3Bvar%20x%20%3D%200%3Bvar%20dane%20%3D%20''%3Bwhile%20(x%3C10)%20%7Bdane%20%3D%20tdane%5Bx%5D.innerText.trim()%3Bwart%20%3D%20twart%5Bx%5D.innerText.trim()%3Btdane%5Bx%5D.style.backgroundColor%20%3D%20%22red%22%3Btwart%5Bx%5D.style.backgroundColor%20%3D%20%22red%22%3Boutput%20%2B%3D%20wart%20%2B%20'%3B'%3Bx%2B%2B%3B%7DcopyThat(output)%3B%7Dif(document.title%3D%3D%22E-MS-Portal%20%7C%20Dane%20podmiotu%22)%20%7 |
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
/** | |
* Napisz program, w którym stworzysz strukturę zawierającą dwie współrzędne całkowite x, y | |
* oraz liczbę rzeczywistą odpowiadającą tym współrzędnym. | |
* | |
* W tworzonym programie powinny działać dwie funkcje: | |
* - pierwsza tworzy dynamiczną tablicę dwuwymiarową o podanych wymiarach i wypełnia ją zerami | |
* (jako parametr ma przekazywać wymiary tablicy) | |
* - druga wypełnia pola tablicy o współrzędnych x i y liczbami rzeczywistymi z tej samej | |
* struktury. Funkcja musi sprawdzać, czy współrzędne w strukturze znajdują się w obrębie | |
* tablicy. Parametrami będą: wskaźnik na tablicę dwuwymiarową, jej wymiary, tablica struktur |
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 | |
// Imports \\ | |
use Illuminate\Filesystem\Filesystem; | |
use Illuminate\Support\Arr; | |
use Whoops\Handler\PrettyPageHandler; | |
// Inside your \App\Exceptions\Handler class \\ |
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
# Usage: | |
# l project-name -a | |
# | |
# Available options: | |
# -a Authentication scaffolding with tests | |
# -g Add Github remote | |
# -d Create a fresh MySQL database | |
# Laravel Zonda | |
function l { |
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
# aliases | |
alias ~="cd ~" | |
alias ..="cd .." | |
alias cd..="cd .." | |
alias ls="ls -G" | |
alias ll="ls -alh" # -S for sort by size | |
alias rmf="rm -rf" | |
alias bat="bat --paging never" | |
alias sourceb="source ~/.bash_profile" |
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 | |
namespace Tests\Feature\Auth; | |
use Tests\TestCase; | |
use Illuminate\Foundation\Testing\WithFaker; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
class LoginTest extends TestCase | |
{ |
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 | |
namespace Tests\Feature\Auth; | |
use Tests\TestCase; | |
use Illuminate\Foundation\Testing\WithFaker; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
class LoginTest extends TestCase | |
{ |
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 | |
// ... | |
class LoginTest extends TestCase | |
{ | |
public function test_user_can_view_a_login_form() | |
{ | |
$response = $this->get('/login'); |
OlderNewer