One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
| { | |
| "meta": { | |
| "version": "1.7", | |
| "at": 1582601656, | |
| "collected_dbs": [ | |
| "postgres" | |
| ], | |
| "local": true | |
| }, | |
| "start_time": 1582527353, |
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| $install_go = <<-SCRIPT | |
| sudo apt-get update -y | |
| wget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz | |
| sudo tar -xvf go1.12.7.linux-amd64.tar.gz | |
| sudo mv go /usr/local | |
| cd ~ |
| # Check whether EBS volume already attached | |
| lsblk | |
| # Check EBS volume filesystem | |
| sudo file -s /dev/xvdf | |
| # If type of filesystem still 'data' it means no filesystem yet, we have to create it | |
| sudo mkfs -t ext4 /dev/xvdf |
| -- Create a group with read-only access | |
| CREATE ROLE readonly; | |
| -- Grant access on public sheme to existing tables | |
| GRANT USAGE ON SCHEMA public TO readonly; | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly; -- grant access to future tables | |
| -- Grant access to specific database, repeat code below for each database | |
| GRANT CONNECT ON DATABASE db_name to readonly; | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO readonly; -- grant access to future tables |
| n = gets.to_i | |
| # Get infinity list of number | |
| 2.upto(Float::INFINITY) | |
| # Use Enum#lazy method | |
| .lazy | |
| # Find prime number | |
| .select { |i| (2..Math.sqrt(i)).none? { |a| (i % a).zero? }} | |
| # Limit infinity list of number by 200 | |
| .first(200) | |
| # Find palindrome prime number |
| #!/usr/bin/env ruby | |
| str = "Jul qvq gur puvpxra pebff gur ebnq?" | |
| def rot13(secret_messages) | |
| upcase_alphabet = ("A".."Z").to_a | |
| downcase_alphabet = ("a".."z").to_a | |
| upcase_rot13 = [] | |
| upcase_length = upcase_alphabet.length | |
| downcase_length = downcase_alphabet.length |
| Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna! | |
| ([一-龯]) | |
| Regex for matching Hirgana or Katakana | |
| ([ぁ-んァ-ン]) | |
| Regex for matching Non-Hirgana or Non-Katakana | |
| ([^ぁ-んァ-ン]) | |
| Regex for matching Hirgana or Katakana or basic punctuation (、。’) |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
| # start model test | |
| require "spec_helper" | |
| module Mesin | |
| describe User do | |
| before do | |
| @customer = create(:role, :customer) | |
| @super_admin = create(:role, :super_admin) | |
| end |