Skip to content

Instantly share code, notes, and snippets.

View najamelan's full-sized avatar
🖥️
Happy Hacking

Naja Melan najamelan

🖥️
Happy Hacking
View GitHub Profile
@najamelan
najamelan / gist:3561e46039ca5b91be357f97fbe6739c
Created July 8, 2017 22:41 — forked from bds/gist:7837545
Offline Ruby Core and Stdlib Documentation with Yard
# http://devrandom.postr.hu/offline-ruby-core-and-stdlib-documentation-with-yard
$ gem install yard
$ wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
$ tar xzvf ruby-2.0.0-p247.tar.gz
$ cd ruby-2.0.0-p247
$ yardoc *.c
$ yardoc -b .yardoc-stdlib -o doc-stdlib
$ yard server -m ruby-core2.0 .yardoc stdlib .yardoc-stdlib
@najamelan
najamelan / ruby_splat.rb
Created July 4, 2016 10:56 — forked from francisco-rojas/ruby_splat.rb
Ruby Splat Operator
# https://gist.github.com/francisco-rojas/db0fb04ed6aa509acc18
# https://dev.firmafon.dk/blog/drat-ruby-has-a-double-splat/
# http://blog.simplificator.com/2015/03/20/ruby-and-the-double-splat-operator/
# http://chriszetter.com/blog/2012/11/02/keyword-arguments-in-ruby-2-dot-0/
# ------------------------------------------------------Method Definition-----------------------------------------------------
puts "\n---Method Definition---\n"
def say(what, *people)
people.each { |person| puts "#{person}: #{what}" }
end
say "Hello!", "Alice", "Bob", "Carl"
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -H -F github.com