Skip to content

Instantly share code, notes, and snippets.

View 2get's full-sized avatar
😌
Think

Mayoto Yoshida 2get

😌
Think
  • GMO Pepabo, Inc.
  • Tokyo, Japan
View GitHub Profile
@2get
2get / pepabo_managers_advent_calendar_2022_12_07.md
Created December 7, 2022 15:00
書くことがない状態で記事を書く

書くことがない状態で記事を書く

書くことがない状態で記事を書く
まずそのような状態がなぜ発生するのか
それはアドベントカレンダーに空いている日があったから
空いている日があったから予定を抑えたのである

さてその次にすべきはどんな記事を書くかを考えることである
わたしはペパボのマネージャーたちが送るアドベントカレンダーに登録をしたので、マネージャーに関して記事を書くのが良いであろうと考えた

Keybase proof

I hereby claim:

  • I am 2get on github.
  • I am 2get (https://keybase.io/2get) on keybase.
  • I have a public key ASD8ruy9U6hXCUimRp8sViACrZWizyF_DyI23n7yDZVUUwo

To claim this, I am signing this object:

@2get
2get / images.js.erb
Created May 20, 2016 06:45
Reference Rails asset images in JS
<%
imgs = {}
Dir.chdir("#{Rails.root}/app/assets/images") do
imgs = Dir.glob("**/*.{gif,jpg,jpeg,png}").inject({}) { |h, f| h.merge! f => image_path(f) }
end
%>
window.image_path = function(name) {
return <%= imgs.to_json %>[name];
};
@2get
2get / install_docker-compose_to_coreos.sh
Created September 6, 2015 07:02
Install docker-compose to CoreOS
#!/bin/bash
COMPOSE_VERSION=1.4.0
curl -L https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` > ~/docker-compose
sudo mkdir -p /opt/bin
sudo mv ~/docker-compose /opt/bin/docker-compose
sudo chown root:root /opt/bin/docker-compose
sudo chmod +x /opt/bin/docker-compose
@2get
2get / sekigae2015.md
Created June 24, 2015 05:27
sekigae2015
cat names.txt | while read x; do echo -e “$RANDOM\t$x"; done | sort -k1,1n | cut -f 2- | paste - - - | column -t
cat names.txt | sort -R | paste - - - | column -t
@2get
2get / ssl_proxy.conf
Last active August 29, 2015 14:17
Configure Nginx with non SSL and SSL as a Reverse Proxy for Local Application Server
server {
listen 80;
server_name dev.localhost;
client_max_body_size 300m;
proxy_set_header Host $http_host;
location / {
@2get
2get / gulp_tasks_test.js
Created March 15, 2015 11:45
BacktopJS (CasperJS) SSL Site Capture
var tests = ['--ssl-protocol=tlsv1', '--ignore-ssl-errors=true', 'capture/genBitmaps.js'];
var casperProcess = (process.platform === "win32" ? "casperjs.cmd" : "casperjs");
var casperChild = spawn(casperProcess, tests);
@2get
2get / case_return.rb
Created February 5, 2015 06:11
case 式の返り値に対しての処理
def case1
i = 1
case i
when 1
5
end + 10
end
def case2
@2get
2get / config.ru
Created December 17, 2014 13:58
The Single-File Rails Application
require 'rubygems'
require 'rails'
require 'active_support/railtie'
require 'action_dispatch/railtie'
require 'action_controller/railtie'
class SingleFile < Rails::Application
config.eager_load = true
config.cache_classes = true
@2get
2get / config.ru
Created December 17, 2014 13:51
Hello Rack
require 'rack'
class HelloRack
def call(env)
[200, { 'Content-Type' => 'text/html' }, ['Hello Rack!']]
end
end
run HelloRack.new