:%s/WORD/&/gn
:%s;//.*;;g
%s/^\s*//g
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity 0.8.7; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.5.0/contracts/token/ERC20/ERC20.sol"; | |
contract TestCoin is ERC20 { | |
constructor( | |
string memory name, | |
string memory symbol | |
) ERC20(name, symbol) { |
Rails.application.routes.routes.named_routes.values.map { |v| v.path.source } | |
=> ["\\A/letter_opener", | |
"\\A/\\Z", | |
"\\A/users/sign_in(?:\\.([^/.?]+))?\\Z", | |
"\\A/users/sign_in(?:\\.([^/.?]+))?\\Z", | |
"\\A/users/sign_out(?:\\.([^/.?]+))?\\Z", | |
"\\A/users/password(?:\\.([^/.?]+))?\\Z", | |
"\\A/users/password/new(?:\\.([^/.?]+))?\\Z", | |
"\\A/users/password/edit(?:\\.([^/.?]+))?\\Z", | |
"\\A/users/cancel(?:\\.([^/.?]+))?\\Z", |
module HogeHelper | |
def simple_label(model_name, column) | |
i18n_scope = "simple_form.labels" | |
t("#{model_name}.#{column}", scope: i18n_scope, default: t("defaults.#{column}", scope: i18n_scope)) | |
end | |
end | |
# I18n.locale = :ja | |
# simple_label(:article, :title) | |
# => ja.simple_form.labels.article.titleを見に行く |
Process: Python [30436] | |
Path: /usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/Resources/Python.app/Contents/MacOS/Python | |
Identifier: org.python.python | |
Version: 3.5.1 (3.5.1) | |
Code Type: X86-64 (Native) | |
Parent Process: zsh [633] | |
Responsible: iTerm [548] | |
User ID: 501 | |
Date/Time: 2016-01-21 21:58:57.213 +0900 |
# NOTE | |
# 分報を書くためのツール | |
# ずっとファイルをひらっきぱなしってのも無いなと思ったので、ずっとターミナルは開いてるだろうからコマンドでかけるようにしたらいいんじゃないかと思った | |
# USAGE | |
# thor install https://gist.githubusercontent.com/mitaku/4040ca77a4f8dcc545c8/raw/3b881ac6c0faff7c75a9cc861f43a1d1f5002d71/diary.thor --as diary | |
# export DIARY_PATH=~/diary | |
# thor diary hogehgoe | |
class ReversibleEncryptedString < BasicObject | |
def initialize(str) | |
@str = str | |
end | |
def decrypted_string | |
@raw ||= ::ReversibleCryptography::Message.decrypt(@str, ::ENV["REVERSIBLE_CRYPTOGRAPY_SECRET"]) | |
end | |
alias_method :to_s, :decrypted_string |
def traverse(dir, &block) | |
Dir.glob("#{dir}/*").each do |f| | |
if File.file?(f) | |
block.call(dir, f) | |
elsif File.directory?(f) | |
traverse(f, &block) | |
end | |
end | |
end |
# RubimaTest::Application.routes.draw do | |
# resources :users | |
# root :to => "welcome#index" | |
# end | |
Benchmark.bmbm do |x| | |
x.report("named_helper") do | |
10000.times do | |
app.url_for(app.users_url) | |
end |