Skip to content

Instantly share code, notes, and snippets.

saboyutaka saboyutaka

Block or report user

Report or block saboyutaka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@saboyutaka
saboyutaka / answer.rb
Last active Nov 1, 2019
RubyからSQLを実行する課題の答え
View answer.rb
require 'pg'
# macの方 userを自分の名前(whoamiで出た名前)に変更する
client = PG::connect(
:host => "localhost",
:user => 'xxxxxxxxxx',
:password => '',
:dbname => "myapp")
# Windowsの方
View Brewfile
cask_args appdir: '/Applications'
tap 'caskroom/cask'
# tap 'homebrew/php'
brew 'azure-cli'
brew 'ctop'
brew 'curl'
brew 'ghq'
brew 'gist'
brew 'git'
@saboyutaka
saboyutaka / custom.xml
Created Nov 15, 2018
PhpStorm2018.2 keymaps
View custom.xml
<keymap version="1" name="custom" parent="Mac OS X 10.5+">
<action id="$Redo">
<keyboard-shortcut first-keystroke="shift meta z" />
</action>
<action id="ActivateDatabaseToolWindow">
<keyboard-shortcut first-keystroke="ctrl g" second-keystroke="ctrl d" />
<keyboard-shortcut first-keystroke="meta 0" />
</action>
<action id="ActivateRoutesToolWindow">
<keyboard-shortcut first-keystroke="ctrl g" second-keystroke="r" />
View teniss.1d.rb
#!/usr/bin/env /Users/yutaka/.rbenv/shims/ruby
ENV['PATH'] += ':/usr/local/bin'
require 'capybara/poltergeist'
require 'date'
require 'open3'
require 'dotenv'
Dotenv.load File.expand_path('../.env', __FILE__)
puts ':tennis:'
View post.sh
#!/bin/bash
if [ $# -ne 2 ]; then
echo "引数にチーム名と点数を入力してください。" 1>&2
echo "e.g. sh post.sh xxxx 10000"
exit 1
fi
FIREBASE=ishocon2-geeoki-201809
TEAM=$1
@saboyutaka
saboyutaka / install-ngx-mruby.sh
Created Aug 17, 2018
CentOSにngx-mrubyを入れるscript
View install-ngx-mruby.sh
yum -y update
yum -y install \
git \
gcc \
wget \
curl \
rake \
bison \
openssl-devel \
make
View gist:47536cc370923fad8e6160120dbf2941
version: '3'
services:
nginx:
image: nginx
ports:
- 80:80
mitmweb:
image: mitmproxy/mitmproxy
tty: true
ports:
@saboyutaka
saboyutaka / myapp.rb
Last active Aug 2, 2018
Sinatra sample #1
View myapp.rb
require 'sinatra'
require 'sinatra/reloader' if development?
class User
attr_accessor :first_name, :last_name, :age
def initialize(last_name, first_name, age)
self.last_name = last_name
self.first_name = first_name
self.age = age
@saboyutaka
saboyutaka / frogs_scraping.rb
Created Aug 2, 2018
スクレイピングの実演
View frogs_scraping.rb
require 'nokogiri'
require 'httparty'
url = 'https://www.ryukyu-frogs.com/information/'
res = HTTParty.get(url)
doc = Nokogiri::HTML.parse(res.body)
doc.css('.news-list li').each do |node|
puts node.css('.content .title').text
end
@saboyutaka
saboyutaka / user_sample.rb
Created Aug 2, 2018
クラスの宣言、インスタンス生成のサンプル
View user_sample.rb
class User
attr_accessor :first_name, :last_name, :age
// コンストラクタ Constructor
def initialize(last_name, first_name, age)
self.last_name = last_name
self.first_name = first_name
self.age = age
end
You can’t perform that action at this time.