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
# ----------- | |
# Explanation | |
mkdir tmp | |
echo "exit 0" > test | |
./test && echo "commit" || echo "revert" | |
# Should output "commit" | |
echo "exit 1" > test | |
./test && echo "commit" || echo "revert" |
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
-ea | |
-server | |
-Xms2048m | |
-Xmx4096m | |
-Xss2m | |
-Xverify:none | |
-Dawt.useSystemAAFontSettings=lcd | |
-Dfile.encoding=UTF-8 |
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 | |
echo "Javi no es el mejor."; |
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 | |
final class RenameUserCommand extends Command | |
{ | |
private $userId; | |
private $newName; | |
public function __construct(string $userId, string $newName) | |
{ | |
$this->userId = $userId; |
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 | |
// We want to find all users born after 1950 | |
$users = [new User(1994), new User(2000), new User(1900), new User(25)]; | |
$usersBornedAfter1950 = []; | |
foreach ($users as $user) { | |
if ($user->birthYear() > 1950) { |
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
alias phpunit='./vendor/bin/phpunit --colors' | |
alias pf='./vendor/bin/phpunit --filter' | |
alias ..='cd ..' | |
alias ll='ls -alF' | |
alias la='ls -A' |
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
casper.on("page.error", function(msg, trace) { | |
this.echo("Error: " + msg, "ERROR"); | |
this.echo("file: " + trace[0].file, "WARNING"); | |
this.echo("line: " + trace[0].line, "WARNING"); | |
this.echo("function: " + trace[0]["function"], "WARNING"); | |
}); | |
casper.on('remote.message', function(message) { | |
this.echo('Remote: ' + message); | |
}); |
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 | |
App::after(function($request, $response) | |
{ | |
// Elimina esta condición si quieres probarlo en local | |
if (App::Environment() == 'production') | |
{ | |
if ($response instanceof Illuminate\Http\Response) | |
{ | |
$output = $response->getOriginalContent(); |
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
// Execute in the javascript console | |
// Ensure that you scroll to the bottom first | |
/** | |
* Execute in https://twitter.com/following to unfollow all users | |
*/ | |
$('.profile-stream .following button').click(); | |
/** | |
* Execute in https://twitter.com/followers to follow all users |
NewerOlder