Skip to content

Instantly share code, notes, and snippets.

View kbparagua's full-sized avatar

Karl Bryan Paragua kbparagua

View GitHub Profile
class Pacman
def self.get_instance
# instantiate the singleton instance if it is not existing yet.
if @instance.nil?
@instance = Pacman.new
end
@instance
end
# move up the singleton instance
Pacman.instance.move_up
# the same instance will move right
Pacman.instance.move_right
# the same instance will move down
Pacman.instance.move_down
We couldn’t find that file to show.
@kbparagua
kbparagua / 9605.rb
Last active January 11, 2017 07:18
prefixes = [
:generic_uncommon, :missing_information, :closed_account, :incorrect_information, :insufficient_funds, :not_authorized
]
['', '_follow_up', '_suspended'].each do |suffix|
prefixes.each do |prefix|
method = "#{prefix}#{suffix}"
FailedBillingMailer.send(method, Company.full_service.active.last).deliver
end
end

Ruby Style Guide

This style guide is based on this community style guide.

Most of the rules listed will have a brief explanation to understand the reasoning behind each. If none is provided, maybe it's too obvious, or assume that its main purpose is to improve readability.

All new projects must adhere to this style guide. Existing and ongoing projects should stick with their current conventions or they can adapt this if no convention is being followed yet.

General

@kbparagua
kbparagua / tmux.conf
Created March 24, 2018 03:58 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
{
	"bold_folder_labels": true,
	"color_scheme": "Packages/Materialize/schemes/Material Solarized Dark.tmTheme",
	"ensure_newline_at_eof_on_save": true,
	"font_size": 14,
	"highlight_line": true,
	"ignored_packages":
	[
	],