Skip to content

Instantly share code, notes, and snippets.

View rgomezcasas's full-sized avatar
☀️
deletin' code

Rafa Gómez rgomezcasas

☀️
deletin' code
View GitHub Profile
@rgomezcasas
rgomezcasas / tcr.sh
Last active June 16, 2020 07:14
TCR
# -----------
# Explanation
mkdir tmp
echo "exit 0" > test
./test && echo "commit" || echo "revert"
# Should output "commit"
echo "exit 1" > test
./test && echo "commit" || echo "revert"
@rgomezcasas
rgomezcasas / Idea.vmoptions
Created April 25, 2018 08:41
Best vm options configuration for Scala Intellij
-ea
-server
-Xms2048m
-Xmx4096m
-Xss2m
-Xverify:none
-Dawt.useSystemAAFontSettings=lcd
-Dfile.encoding=UTF-8
@rgomezcasas
rgomezcasas / javi.php
Created September 18, 2017 18:17
Whatever
<?php
echo "Javi no es el mejor.";
@rgomezcasas
rgomezcasas / RenameUserCommand.php
Created September 18, 2017 18:08
Command Example
<?php
final class RenameUserCommand extends Command
{
private $userId;
private $newName;
public function __construct(string $userId, string $newName)
{
$this->userId = $userId;
<?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) {
@rgomezcasas
rgomezcasas / .bashrc
Last active September 27, 2016 13:19
Basic [dot]files
alias phpunit='./vendor/bin/phpunit --colors'
alias pf='./vendor/bin/phpunit --filter'
alias ..='cd ..'
alias ll='ls -alF'
alias la='ls -A'
@rgomezcasas
rgomezcasas / casper-helpers.js
Created March 31, 2015 14:49
Casper Helpers
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);
});
@rgomezcasas
rgomezcasas / filters.php
Last active December 24, 2015 10:49 — forked from garagesocial/filters.php
Minificar salida del HTML en Laravel 4
<?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();
@rgomezcasas
rgomezcasas / twitter_follow.js
Created July 12, 2013 09:22
Twitter: Only follow who is following you
// 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