Skip to content

Instantly share code, notes, and snippets.

View vovimayhem's full-sized avatar
🎸
Taking names and kicking ass

Roberto Quintanilla vovimayhem

🎸
Taking names and kicking ass
View GitHub Profile
@vovimayhem
vovimayhem / remove-vscode
Last active February 18, 2023 21:15
Completely remove Visual Studio Code on Mac 2023
#! /bin/zsh
sudo rm -rf "/Applications/Visual Studio Code.app"
sudo rm -rf /System/Volumes/Data/usr/local/bin/code
rm -rf ~/Library/Application\ Support/Code
rm -rf ~/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.vscode.sfl2
rm -rf ~/Library/Caches/com.microsoft.VSCode*
rm -rf ~/Library/HTTPStorages/com.microsoft.VSCode*
rm -rf ~/Library/Preferences/ByHost/com.microsoft.VSCode*
rm -rf ~/Library/Preferences/com.microsoft.VSCode*
@vovimayhem
vovimayhem / Gemfile
Last active January 3, 2022 17:20
Spec mocks failing on ruby 3
# frozen_string_literal: true
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'rspec', github: 'rspec/rspec-metagem', ref: 'main'
gem 'rspec-core', github: 'rspec/rspec-core', ref: 'main'
gem 'rspec-expectations', github: 'rspec/rspec-expectations', ref: 'main'
gem 'rspec-mocks', github: 'rspec/rspec-mocks', ref: 'main'
gem 'rspec-support', github: 'rspec/rspec-support', ref: 'main'
@vovimayhem
vovimayhem / airbrake.rb
Created July 15, 2019 20:38
Airbrake Initializer
# Airbrake is an online tool that provides robust exception tracking in your Rails
# applications. In doing so, it allows you to easily review errors, tie an error
# to an individual piece of code, and trace the cause back to recent
# changes. Airbrake enables for easy categorization, searching, and prioritization
# of exceptions so that when errors occur, your team can quickly determine the
# root cause.
#
# Configuration details:
# https://github.com/airbrake/airbrake-ruby#configuration
require 'airbrake/sidekiq'
@vovimayhem
vovimayhem / json-api-infinity.js
Created June 13, 2019 17:15
ember-infinity and jsonapi pagination
import { resolve } from 'rsvp';
import { merge } from '@ember/polyfills';
import { isPresent } from '@ember/utils';
import InfinityModel from 'ember-infinity/lib/infinity-model';
export default InfinityModel.extend({
canLoadMore: true,
buildParams(increment) {
let pageParams = {};
@vovimayhem
vovimayhem / Dockerfile
Last active May 25, 2019 20:00
Ejemplo Dockerfile para app compilada de js
####################################################################################################
# Stage I - The builder stage: We'll use as much as the same commands (layers) on the dev.Dockerfile
# so we can use the cache as much as possible:
# 1: Use node 8 as base:
FROM node:8-alpine as development
# 2: We'll set the application path as the working directory
WORKDIR /usr/src
@vovimayhem
vovimayhem / dev-entrypoint.sh
Last active March 23, 2019 17:18
Development Entrypoint for PHP
#! /bin/sh
# The Docker App Container's development entrypoint.
# This is a script used by the project's Docker development environment to
# setup the app containers and databases upon runnning.
set -e
: ${APP_PATH:="/usr/src"}
: ${APP_TEMP_PATH:="$APP_PATH/tmp"}
: ${APP_SETUP_LOCK:="$APP_TEMP_PATH/setup.lock"}
@vovimayhem
vovimayhem / docker-flow-stack.yml
Created March 12, 2019 01:55
Docker Flow example for Docker Swarm
# Deploy using `docker stack deploy -f docker-flow-stack.yml docker_flow`
version: '3.7'
networks:
network: # Allows referring to 'docker_flow_network' on other stacks
services:
proxy:
image: dockerflow/docker-flow-proxy:19.03.02-16
ports:
@vovimayhem
vovimayhem / common-services.yml
Created February 25, 2019 22:59
Ejemplo de Sidekiq + Docker
version: "2.4"
volumes:
postgres_data:
redis_data:
rabbit_data:
networks:
backend:
@vovimayhem
vovimayhem / rails
Last active February 25, 2019 21:49
Changes to common rails wrapper script
#!/usr/bin/env ruby
# This file is located at `bin/rails`
# Load the 'switch_user_and_exec' routine:
require_relative '../config/switch_user_and_exec'
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
@vovimayhem
vovimayhem / Dockerfile
Last active February 25, 2019 21:29
Example of a development dockerfile & compose replicating the host's user
# Other parts of the file omitted for clarity:
# I: Runtime Stage: ============================================================
FROM ruby:2.6.1-alpine AS runtime
WORKDIR /usr/src
ENV HOME=/usr/src PATH=/usr/src/bin:$PATH
RUN apk add --no-cache ca-certificates less libpq nodejs npm openssl su-exec tzdata