git fetch origin
git reset --hard origin/master
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# Usage: | |
# class ServiceX | |
# include UnderscoreLog | |
# | |
# def initialize | |
# end | |
# | |
# def call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
module Jotter | |
def jot_info(tag = '') | |
Rails.logger.tagged(facility + " #{tag}") do | |
Rails.logger.info { yield } | |
end | |
end | |
def jot_debug(tag = '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Kat Padilla | |
email = hello@******.ph | |
[core] | |
excludesfile = /Users/katpadi/.gitignore_global | |
[difftool "sourcetree"] | |
cmd = opendiff \"$LOCAL\" \"$REMOTE\" | |
path = | |
[mergetool "sourcetree"] | |
cmd = /Applications/Sourcetree 3.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk -F'[ :,]' '{a[$1":"$2"["$10 "["$16"]"]++}END{for(i in a){if(a[i] > 3){print i "-" a[i]}}}' dups.log | |
awk -F'[ :,]' '{print $1":"$2":"$3"["$10 "["$16"]"}' dups.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Gracefully | |
class << self | |
alias_method :handle, :new | |
end | |
attr_reader :error, :value | |
def initialize | |
@value = nil | |
@error = nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bulky | |
# | |
# Bulky is a simple ActiveRecord extension to insert or update a bulk of rows in a single statement. | |
# | |
module Bulky | |
# Bulk insert multiple rows into a table | |
# | |
# Usage: | |
# | |
# Post.bulk_insert(['name', 'label'], [['ch', 'Label 1'], ['ch_2', 'Label 2']]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Gracefully | |
class << self | |
alias_method :handle, :new | |
end | |
attr_reader :error, :value | |
# Accepts a block, invokes it, and wraps the return value in an | |
# exception-free `Gracefully` object | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ruby-prof' | |
# | |
# This will use ruby-prof and print in a nice way. | |
# | |
# Input params: | |
# file_name = File name of output | |
# printer = graph || flat || stack | |
# | |
# Output format: | |
# E.g.: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NumFeels | |
attr_reader :number | |
def initialize(number) | |
@number = number | |
end | |
def happy? | |
fail ArgumentError if number < 0 | |
sum = 0 |
NewerOlder