Skip to content

Instantly share code, notes, and snippets.

View rogervila's full-sized avatar
:octocat:
Loving Open Source

Roger Vilà rogervila

:octocat:
Loving Open Source
View GitHub Profile
@rogervila
rogervila / vscode.keybindings.json
Created August 25, 2024 21:32
VSCode keybindings
// Place your key bindings in this file to override the defaults
[
{
"key": "cmd+[Semicolon]",
"command": "workbench.action.terminal.new",
"when": "terminalProcessSupported || terminalWebExtensionContributedProfile"
},
{
"key": "ctrl+shift+`",
"command": "-workbench.action.terminal.new",
@rogervila
rogervila / docker-compose.yml
Last active March 23, 2022 11:22
Global services docker-compose.yml file
version: "3.8"
services:
# MySQL Database
mysql:
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
@rogervila
rogervila / Preferences.sublime-settings
Created November 22, 2021 13:25
Preferences.sublime-settings
{
"auto_complete": true,
"auto_complete_triggers": [],
"bold_folder_labels": true,
"caret_style": "phase",
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
"font_size": 17,
"highlight_line": true,
"ignored_packages":
@rogervila
rogervila / Dockerfile
Created June 23, 2021 09:13
Laravel Dockerfile
FROM php:8.0-apache
WORKDIR /var/www
ENV DEBIAN_FRONTEND noninteractive
ENV APACHE_DOCUMENT_ROOT="/var/www/public"
RUN \
apt-get update -y && \
apt-get install -y --no-install-recommends curl git zip unzip libzip-dev && \
@rogervila
rogervila / array-diff-with-multidimensional-arrays-error.php
Created January 14, 2021 20:25
array_diff() error when passing multidimensional arrays
<?php
$a = [
'a' => [
'b' => 'Hello',
],
];
$b = [
'a' => [
@rogervila
rogervila / array-diff-example.php
Last active January 14, 2021 20:15
Array Diff Example
<?php
$a = [
'a' => 'Hello',
'c' => 'd',
];
$b = [
'a' => 'Goodbye',
'c' => 'd',
@rogervila
rogervila / export_variables_from_file.sh
Created June 19, 2020 13:14
Export variables from file
# Original: https://unix.stackexchange.com/questions/79064/how-to-export-variables-from-a-file
source .env
export $(cut -d= -f1 .env)
@rogervila
rogervila / .bashrc
Created April 4, 2020 17:34
.bashrc
# Gems
export PATH="/usr/local/lib/ruby/gems/2.6.0/bin:$PATH"
# Composer
export PATH="$PATH:$HOME/.composer/vendor/bin"
# PHP 7.1
#export PATH="/usr/local/opt/[email protected]/bin:$PATH"
#export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
## brew unlink php && brew link [email protected]
@rogervila
rogervila / run-mysql.sh
Last active March 29, 2020 11:07
Run MySQL with Docker
#!/usr/bin/env bash
echo -e "\\e[32mWait...\\e[0m"
docker network create -d bridge db || true
echo -e "\\e[32mDone! db network created\\e[0m"
echo -e "\\e[32mWait...\\e[0m"
docker run -d -p 3306:3306 --name mysql --restart always \
--network=db \
@rogervila
rogervila / run-redis.sh
Last active March 30, 2020 19:27
Run Redis with Docker
#!/usr/bin/env bash
echo -e "\\e[32mWait...\\e[0m"
docker network create -d bridge redis || true
echo -e "\\e[32mDone! redis network created\\e[0m"
echo -e "\\e[32mWait...\\e[0m"
docker run -d -p 6379:6379 --name redis --restart always \
--network=redis \