Skip to content

Instantly share code, notes, and snippets.

@mimosa
mimosa / bench.rb
Last active May 28, 2018 03:12
roar vs ams vs rabl vs jbuilder
require 'bundler'
require 'active_model_serializers'
require 'roar/decorator'
require 'roar/json'
require 'rabl'
require 'jbuilder'
require 'benchmark'
require 'ffaker'
Post = Struct.new(:id, :author, :body, :draft) do
@mimosa
mimosa / README.md
Created May 15, 2017 15:11
Rack::Proxy

Gemfile

...
gem 'rack-proxy', require: 'rack/proxy'
...

config.ru

@mimosa
mimosa / benchmark.rb
Created October 11, 2017 16:51
active_model_serializers VS rabl
# frozen_string_literal: true
require 'oj'
require 'rabl'
require 'active_model_serializers'
require 'benchmark/memory'
require 'benchmark/ips'
Rabl.configure do |c|
c.view_paths << 'app/views'
@mimosa
mimosa / config.fish
Last active April 2, 2018 23:22
fish is a smart and user-friendly command line shell.
# homebrew
set -e fish_user_paths
set -U fish_user_paths /usr/local/bin $fish_user_paths
set bins libressl icu4c llvm sphinx-doc ncurses go/libexec
for bin in $bins
set -U fish_user_paths /usr/local/opt/$bin/bin $fish_user_paths
end
set -e bins
@mimosa
mimosa / openpgp.txt
Created November 20, 2017 13:48
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:1eedcf6f06230d1d89b0870328d70c28135961a5]
@mimosa
mimosa / openpgp.txt
Created November 20, 2017 13:48
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:1eedcf6f06230d1d89b0870328d70c28135961a5]
@mimosa
mimosa / openpgp.txt
Created November 20, 2017 13:51
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:1eedcf6f06230d1d89b0870328d70c28135961a5]
@mimosa
mimosa / README.md
Created September 28, 2021 10:00
Resource Sign Service
❯ rspec resource_sign_service_spec.rb
----| Hash test |----
{:a=>{:b=>"b", :c=>"c"}, :d=>"d"}  vs  {:d=>"d", :a=>{:c=>"c", :b=>"b"}}
+dIsjfhtier7LrkhmcNC9g==  vs  +dIsjfhtier7LrkhmcNC9g==
________________________________________________________________________________________
.----| Array test |----
[{:a=>{:b=>"b", :c=>"c"}, :d=>"d"}, {:d=>"d", :a=>{:c=>"c", :b=>"b"}}]  vs  [{:d=>"d", :a=>{:c=>"c", :b=>"b"}}, {:a=>{:b=>"b", :c=>"c"}, :d=>"d"}]
nGY1apVXDjKbeEtURBYe3A==  vs  nGY1apVXDjKbeEtURBYe3A==
________________________________________________________________________________________
@mimosa
mimosa / .zprofile
Last active October 27, 2021 07:25
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
# Customize to your needs...
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
size: 66241 bytes (64831 left)
0:boardflags2=0x4
0:boardflags3=0x40000000
0:boardflags4=0x30008
0:boardflags=0x00001000
1:boardflags2=0x4
1:boardflags3=0x0
1:boardflags4=0x00020108
1:boardflags=0x10000000