Skip to content

Instantly share code, notes, and snippets.

View jmscarnatto's full-sized avatar
🎯
Focusing

Jose Scarnatto jmscarnatto

🎯
Focusing
View GitHub Profile

Commit - Clone a container or snapshot

docker commit my_origin_container my_container_snapshot:yymmdd
docker run --name=my_clone my_container_snapshot:yymmdd

Delete stopped containers

docker container prune

Data->Multiple Operatios

Data Table function in ms-excel

@jmscarnatto
jmscarnatto / gist:0844abb7ad75b059ee5d8710d65d73d5
Created August 16, 2022 12:36
Add oh-my-zsh with powerlevel10k to Dockerfile
ENV HOME=/home/dev
# INSTALL APT DEPENDENCIES
RUN apt-get update -qq && apt-get upgrade -y && apt-get install -y --no-install-recommends build-essential git wget zsh
# OH-MY-ZSH
RUN wget -P $HOME https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh; \
sh $HOME/install.sh; \
rm $HOME/install.sh
@jmscarnatto
jmscarnatto / .zshrc
Last active September 25, 2024 14:02
.zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@jmscarnatto
jmscarnatto / rails_react.md
Last active September 29, 2022 13:59
Docker + Rails + React + Tailwind
  1. Create the project structure
docker run -it --rm -v ${PWD}:/usr/src/app -w /usr/src/app ruby:3.1.2 bash -c 'gem install rails && rails new trader-bot -T -d mysql -c tailwind'
  1. /<project_name>/Dockerfile

wget https://github.com/jmscarnatto/dockerfile-rails7/raw/main/Dockerfile

@jmscarnatto
jmscarnatto / vscode_ruby_snippets.json
Created December 14, 2022 15:00
vscode ruby snippets
# ~/Library/Application Support/Code/User/snippets/ruby.json
{
// Place your snippets for ruby here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
@jmscarnatto
jmscarnatto / gtk.css
Last active October 16, 2024 12:07
script for quick installation of zsh on Ubuntu
# For Gnome terminal
# add or edit ~/.config/gtk-3.0/gtk.css
VteTerminal,
TerminalScreen,
vte-terminal {
padding: 10px 10px 30px 10px;
-VteTerminal-inner-border: 10px 10px 30px 10px;
}
@jmscarnatto
jmscarnatto / ruby_snippets.md
Last active February 1, 2024 17:44
ruby_snippets.md

Debug

puts caller(0,10); binding.pry

monitor certain field on model

class YourModel < ActiveRecord::Base
  def myfield=(*args)
@jmscarnatto
jmscarnatto / Rails_patterns_tips.md
Last active October 17, 2023 11:21
Rails patterns design tips and tricks
@jmscarnatto
jmscarnatto / api_properties_client.rb
Last active November 11, 2023 23:48
api_properties_client
# frozen_string_literal: true
require 'uri'
require 'net/http'
require 'json'
require 'webmock/rspec'
class Properties
API_URL = 'https://api.stagingeb.com/v1/properties'
API_KEY = 'l7u502p8v46ba3ppgvj5y2aad50lb9'