Skip to content

Instantly share code, notes, and snippets.

@rafamaciel
rafamaciel / RuntimeEnvSetup.sh
Last active October 13, 2023 06:10
Use a single variable in place of the default environment variables.
#!/bin/sh
if [ $# -eq 0 ]; then
RUNTIME_ENV="development"
else
RUNTIME_ENV="$1"
fi
variaveis=("RAILS_ENV" "NODE_ENV" "GO_ENV" "APP_ENV" "ASPNETCORE_ENVIRONMENT" "MIX_ENV" "FLASK_ENV" "SPRING_PROFILES_ACTIVE" "NODE_ENV" "CONFIGURATION" "BuildConfig.DEBUG" "RUSTFLAGS" "NODE_ENV" "NG_ENV" "REACT_APP_ENV" "FLUTTER_ENVIRONMENT" "AKKA_ENV" "PLACK_ENV" "HASKELL_ENV" "MIX_ENV" "KOTLIN_ENV" "DEBUG" "LISP_ENV")
@rafamaciel
rafamaciel / router_example.go
Created May 13, 2023 21:59
coal_router_examples
package config
Config.Router.Configure(
Route{ get: "/posts/:id", to: "posts#show" },
)
{
cocktails: {
// Ingredient quantities are in fl oz.
'Tom Collins': {
ingredients: [
{ kind: "Farmer's Gin", qty: 1.5 },
{ kind: 'Lemon', qty: 1 },
{ kind: 'Simple Syrup', qty: 0.5 },
{ kind: 'Soda', qty: 2 },
{ kind: 'Angostura', qty: 'dash' },
rake rubycritic:specs:ci | tee /tmp/rubycritic.specs.log
export RUBYCRITIC_SPECS_SCORE=`cat /tmp/rubycritic.specs.log | grep 'Score' | cut -d " " -f 2 | tr -d '()'`
export RUBYCRITIC_SPECS_SCORE=${RUBYCRITIC_SPECS_SCORE%.*}
if [[ $RUBYCRITIC_SPECS_SCORE -lt $RUBYCRITIC_SPECS_MINIMUM_SCORE ]]
then
echo $RUBYCRITIC_SPECS_SCORE
exit 1
fi
@rafamaciel
rafamaciel / pull
Created May 10, 2017 13:27
Docker scripts
#!/bin/bash
source $HOME/.config
IMAGE=$1
echo $DOCKER_USERNAME
echo $DOCKER_PASSWORD
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int lcd_key = 0;
int adc_key_in = 0;
int selected_column = 0;
int selected_row = 0;
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int lcd_key = 0;
int adc_key_in = 0;
int selected_column = 0;
int selected_row = 0;
@rafamaciel
rafamaciel / lcd.cpp
Created August 4, 2015 22:18
Arduino LCD
/*
1602 LCD Keypad Shield Example Code using the LiquidCrystal Library
Library originally added 18 Apr 2008 by David A. Mellis
library modified 5 Jul 2009 by Limor Fried
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe
modified Jan 2013 for the 1602 LCD Keypad Shield
@rafamaciel
rafamaciel / READEME.md
Last active August 29, 2015 14:20
Manger hosts file

Install:

git clone [email protected]:/baec07fffedf7d6e3a04.git hosts  
sudo mv hosts/host_manager.py /usr/bin/hosts
rm -rf hosts
@rafamaciel
rafamaciel / READEME.md
Last active August 29, 2015 14:20
Symfony configuration for openshift...

Remove parameters.yml from .gitignore.

Import parameters.php on app/config/config.yml

imports:  
    - { resource: parameters.php }