Skip to content

Instantly share code, notes, and snippets.

require 'benchmark_driver'
Benchmark.driver do |x|
x.prelude <<~RUBY
require 'teyu'
require 'attr_extras'
class A
def initialize(a:, b:, c:, d:, e:)
@a = a
@b = b
CRYSTALBALL=true bundle exec rspec .
#=> Generate tmp/crystalball_data.yml
# Change Hoge Model code
$ bundle exec crystalball
I, [2019-04-25T16:42:28.037405 #84894] INFO -- : Crystalball starts to glow...
I, [2019-04-25T16:42:28.117924 #84894] INFO -- : Starting RSpec.
Run options: include {:ids=>{"./spec/models/hoge_spec.rb"=>["1:4:1", "1:5:1", "1:1:3:1", "1:1:4:1", "1:1:5:1", "1:1:6:1", "1:1:7:1", "1:1:1:1", "1:2:2:1", "1:2:3:1", "1:3:1:1", "1:3:2:1", "1:3:3:1", "1:2:1:1", "1:1:2:1"]}}
.......FFF.....
require 'active_support'
require "active_support/core_ext"
require 'benchmark'
SingularToPlural = {
"search" => "searches",
"switch" => "switches",
"fix" => "fixes",
"box" => "boxes",
"process" => "processes",
class UserSerializer < ActiveModel::Serializer
attributes :name, :profile, :tweets
def profile
ProfileSerializer.new(object.profile)
end
def tweets
ActiveModel::Serializer::CollectionSerializer.new(
object.tweets,
::::::::::::|     し   //|  | |       |::::::::::::::::::::::::|
:::::::::::|        ノ/ |   | |       |:::::::::::::::::::::::|
:::::::三ミミ==zzzz、ゞミ/ |   |彡ミ,zzzz彡ミ三::::::::::::::::::|
:::::::::::|ヾ、 (  `)`ヾ、ミミ   l彡/(´  )  ソ:::::::::::::::::::::|   天
:::::::::::|   ` ̄ ̄ ̄ //|  |ヾ、  ̄ ̄ ̄´ |::::::::::::::::::::::|    才
::::::::::|      ̄ ̄  / |  |ヽ、  ̄ ̄    |:::::::::::::::::::::|    じ
:::::::::|ミiii、       〈  |  |  〉     ,彡::::::::::::::::::::::|   ゃ
:::::::::|ヾlllllli、       |  |       ,iillllllll:::::::::::::::::::::::|   っ
:::::::::|   ヾii      ノ   ‘,      ii/   |:::::::::::::::::::::::|   た
:::::::::|    ゙|  , -―〈   〉ー-、  |゙    |:::::::::::::::::::::::|   か
pullrequest:
type: object
properties:
id:
type: integer
title:
type: string
repository:
$ref: '#/components/schemas/repository'
authors:
@takanamito
takanamito / user_data.sh
Created March 29, 2018 11:38 — forked from pataiji/user_data.sh
Spot InstanceでDBストレージのdocker imageをbuildしてたやつのメモ
#!/bin/bash
# timezone
sed -ei 's/ZONE=.*/ZONE="Asia\/Tokyo"/' /etc/sysconfig/clock
ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
yum update -y
yum install -y docker mysql
service docker start
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
client
dev tap
proto udp
remote リモートサーバーのIP 1194
resolv-retry infinite
nobind
persist-key
port 1194
proto udp
dev tap
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\server.crt"
key "C:\\Program Files\\OpenVPN\\config\\server.key"
dh "C:\\Program Files\\OpenVPN\\config\\dh1024.pem"
server 10.8.0.0 255.255.255.0