- show_cmds
- whereami
- l or list
- list 22-28 # Range of lines requested
- show_source "Class or Class#method"
- info # Instance variables, local variables, etc
- step # go for next line/point of execution after the breakpoint (line by line)
This file contains hidden or 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
\set ON_ERROR_ROLLBACK interactive | |
\set COMP_KEYWORD_CASE upper | |
\set HISTFILE ~/.psql_history- :USER - :HOST - :PORT - :DBNAME | |
\set PROMPT1 '%M:%[%033[1;31m%]%>%[%033[0m%] %n@%/%R%#%x ' | |
\pset pager off | |
\pset null '(null)' |
This file contains hidden or 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
--- | |
# The paths in which to look for gems | |
# :gempath: | |
# Force specification of gem server host on push | |
# disable_default_gem_server: | |
# A YAML array of remote gem repositories to install gems from | |
# :sources: |
This file contains hidden or 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
def load_gems! | |
%w[irb/completion irb/history irb/color rubygems].each do |gem| | |
require gem | |
end | |
return unless Gem::Version.new(RUBY_VERSION) > Gem::Version.new('2.7.0') | |
require 'irb/easter-egg' | |
end |
This file contains hidden or 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
H4sIANouTmUAA+1aQW/bNhT2BgzDuPN25rqDXaChKYqSbAPO4CRuEyBJMyfdGhRFIMu0LUSWHEqKkxYbdtxp52HXAbvuPOx37LjjjvsPIyXLiby4TgDFbW19gSL5ie/xUdR77yPtfhAMTzjr2JxZQblwL8AYG5oGo7MenzGh8XkMqFCNqJQYKtEhVqhh4ALU7sedNEI/MLlw5dTkAzPg2J3RTjTrdt9gZzyOyfk9QT81/+jE8tyu3UM8zLAP8Tx0SmfPP6FqPP8qxbqhifk3MCEFiDP0YSZWfP4LH33+ceHDQmHPtODTQ/gcjiFlhU/EQcRxJg75+dfbmWwcHbXGl1LjZ3F8OtXkgyv5Z5Y3QOZw6DA05N45c03XYrLBH/v//P3TL789z2CQOWYhHf8H5sU2MzuMl7PMA3PjX8Hp+CdY00T+v8ig77lY8fhXMRwE9oDVFb1a1apUr2jIoFWjQg2FAs2Auzsbjdbm9s43TXRhBgFHN4VrvfF1oxE+Mxz1WDeHTg/QKjwUSrvHb1K6FuPgbT+HVUU6/u+j+s+PfyyE6fqv69jI6/8iwNlZKOZevAKOGdjnDBZTb0QR8NCF20LUGkuQy0Zv2+kcmWGa/6c+I97Ooo9b839KdAUTWf9VHefxvxDk/H+lMYv/Z5kHbs3/J/EvJHrO/xeBFP/XiVLVKJIJWcFVtZrz/6VHOv7vo/rPj39K9en6r2h5/V8IxvwfFrlpnRaB5Zi+n+L7AMIO60LLdJwSc88fAskOhBasw5ZQqdVawgLzo3XBVQPL9JlshYZm0D+x3a4XiUd95sKy4/W8MCiDmGm8UDF5BF8XHc8SKxDPLcL6erwK8Wvl8mg0Qj3P64nMIXJIjVK17DOTW/2vzupCsfjdI/ji5cvIFHN8ltgkGEubYj0bMDdYCy6HLLYbsAv5mg+cSLO4zRzHg13uDaLRfFFMbLkdEP+XxxJnp2n+/4QNurbDMu3jLvv/IgfI9T/V8/X/YvDu8v9///zhd3Xjrx8zGGSOWZjF |
This file contains hidden or 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 'securerandom' | |
SecureRandom.base64(28).slice(0,26).gsub(/(\+|\/)/,("a".."z").to_a. | |
sample) |
This file contains hidden or 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 'test/unit' | |
def integer_to_sixtytwo(n) | |
return '0' if n.zero? | |
sixtytwo_digits = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
result = '' | |
while n > 0 do | |
result << sixtytwo_digits[n % 62] | |
n /= 62 | |
end | |
result.reverse |
This file contains hidden or 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
def move_zeros(nums) | |
return nums if nums.empty? | |
left = 0 | |
right = nums.length - 1 | |
while left < right do | |
if nums[left] == 0 | |
nums[left], nums[right] = nums[right], nums[left] | |
right -= 1 | |
else | |
left += 1 |
This file contains hidden or 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
def minimal_heaviest_subset(weights) | |
weights.sort! | |
half_sum = weights.sum / 2 | |
weights | |
.each_cons(2) | |
.filter {|a, b| a+b >= half_sum} | |
.flatten | |
.uniq | |
end |
This file contains hidden or 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 'uri' | |
require 'net/http' | |
require 'csv' | |
class Downloader | |
attr_accessor :uri, :content | |
def initialize(uri) | |
@uri = URI(uri) | |
@content = nil |
NewerOlder