Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
docker rmi $(docker images -a --filter=dangling=true -q) | |
docker rm $(docker ps --filter=status=exited --filter=status=created -q) | |
docker images -a | grep "pattern" | awk '{print $3}' | xargs docker rmi |
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
["companyA", "companyB", "companyC"] |
# Se durante o processo do sudo apt-get update ocorrer algum erro de pacote | |
# ou de destino nao encontrado, tem que deletar o repositorio | |
# pois nesse momento nao pode ocorrer nenhum erro senao o rvm chora | |
vagrant@homestead:~/Projects/acadrolli$ sudo apt-get update | |
Err http://dl.hhvm.com utopic/main amd64 Packages | |
404 Not Found [IP: 140.211.166.134 80] | |
Err http://dl.hhvm.com utopic/main i386 Packages | |
404 Not Found [IP: 140.211.166.134 80] | |
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/main/source/Sources Hash Sum mismatch |
public function test_atualizar_tarefa_from_user_panel() { | |
Session::start(); // Start a session | |
$this->patch('/projetos/1/tarefa/30', ['progresso' => 10, "_token" => csrf_token()], ['HTTP_REFERER' => 'http://localhost/usuarios/1/tarefa/30/edit']); | |
$this->assertResponseStatus(302); | |
$this->assertRedirectedToRoute('usuarios.tarefa.index', [1]); | |
} | |
// Metodo 2 sem desabilitar middleware | |
Session::start(); // Start a session | |
$response = $this->call('PATCH', '/projetos/1/tarefa/30', array("progresso" => "10", "_token" => csrf_token()), [], [], ['HTTP_REFERER' => 'http://localhost/usuarios/1/tarefa/30/edit']); |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
public function run() { | |
DB::unprepared(File::get('path/to/SQL/file')); | |
} |
function switchKey($array, $newKey) { | |
$newarray = array(); | |
foreach($array as $subarray) { | |
$newarray[$subarray[$newKey]] = $subarray; | |
} | |
unset($array); | |
return $newarray; | |
} |