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
$ dig gori.me | |
; <<>> DiG 9.8.5-P1 <<>> gori.me | |
;; global options: +cmd | |
;; Got answer: | |
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2496 | |
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 0 | |
;; QUESTION SECTION: | |
;gori.me. IN A |
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 A | |
extend ActiveSupport::Concern | |
def a | |
puts "a" | |
end | |
concerning :B do | |
def b | |
puts "b" |
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
#!/usr/bin/env ruby | |
puts "Opening #{ARGV[0]}" | |
puts "Type `exit` to close this session." | |
exec ENV["SHELL"] | |
puts "Bye." |
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
$ wget https://raw.githubusercontent.com/git/git/34d9819e0a387be6d49cffe67458036450d6d0d5/contrib/diff-highlight/diff-highlight | |
$ wget https://gist.githubusercontent.com/a2ikm/2dbfb89114dfa5c543ed/raw/e2d8d550ef601c9310712f4187b803658427dd42/diff-highlight.utf8.patch | |
$ patch -u diff-highlight < diff-highlight.utf8.patch | |
$ chmod +x diff-highlight |
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
aws rds describe-db-instances | jq '.DBInstances[]|select(.DBInstanceIdentifier == "${INSTANCE_IDENTIFIER}")|{DBInstanceIdentifier,AvailabilityZone}' |
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
#!/usr/bin/env ruby | |
SOLO_COMMANDS = %w(bootstrap clean cook prepare) | |
def usage | |
name = File.basename($0) | |
puts <<-EOF | |
Usage: | |
#{name} bootstrap [<options>] |
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 Array | |
def rstrip | |
index = | |
if block_given? | |
rindex { |item| !yield(item) } | |
else | |
rindex { |item| !item.nil? } | |
end | |
if index |
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
module LinksHelper | |
def show_link_to(*records, &block) | |
options = polymorphic_path(records.flatten) | |
html_options = { class: "btn btn-info btn-sm" } | |
link_to t(:show), options, html_options, &block | |
end | |
def new_link_to(*records, &block) | |
records = records.flatten |
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
#%PAM-1.0 | |
auth required pam_nologin.so | |
auth include system-auth | |
account include system-auth | |
session include system-auth |
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
#!/usr/bin/env ruby | |
# | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require "optparse" | |
require "webrick" | |
include WEBrick | |
Process.setproctitle(File.basename(__FILE__)) if Process.respond_to?(:setproctitle) |
OlderNewer