Skip to content

Instantly share code, notes, and snippets.

@lesterzone
lesterzone / Makefile
Created October 4, 2021 14:30 — forked from thomaspoignant/Makefile
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@lesterzone
lesterzone / scratch.rb
Created August 12, 2022 15:52 — forked from mateuszbialowas/scratch.rb
ar-mapping-custom-pk-fk
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'pry'
gem "sqlite3"
gem 'activerecord'
end
@lesterzone
lesterzone / ruby_inheritance.rb
Created October 18, 2023 01:44 — forked from yoelblum/ruby_inheritance.rb
Ruby base class VS including modules (mixins)
# Ruby's inheritance mechanisms are a bit unique and have some subtelties
# There are two main ways to inherit: Direct Inheritance (with a "Base" class) and "Mixins" (including modules)
# "Direct inheritance" (B is the base class of A)
class B
X = 30
def self.static_method
"Hello from static method"
end