Skip to content

Instantly share code, notes, and snippets.

View chsh's full-sized avatar
👍
Love your code.

CHIKURA Shinsaku chsh

👍
Love your code.
View GitHub Profile
@chsh
chsh / file0.rb
Last active October 8, 2017 09:51
irbでソースコードフォルダ毎に履歴を分けて保存する ref: http://qiita.com/chshii/items/ba10dcc8dcc24b315d16
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 80000 # このあたりはお好みで。
require 'digest/md5'
require 'fileutils'
history_base = File.join(ENV['HOME'], '.irb', 'histories')
FileUtils.mkdir_p history_base unless Dir.exist? history_base
pwd_hash = Digest::MD5.hexdigest(`pwd`.chomp)
IRB.conf[:HISTORY_FILE] = File.join(history_base, pwd_hash)
@chsh
chsh / amazon_url_shortener.js
Created September 3, 2017 06:22
Amazon.co.jp URL shortener bookmarklet.
javascript:var asin=document.getElementById('ASIN').value;location.href='http://amazon.jp/dp/'+asin;
@chsh
chsh / Gemfile
Created July 5, 2017 09:14
Nintendo Switch stock checker for my nintendo store. ;-)
source 'https://rubygems.org'
gem 'slack-notifier'
@chsh
chsh / mastodon-sources.md
Last active August 24, 2022 15:30
mastodonのソースコード一覧

mastodonのソースコード一覧

pawoo.netやfriends.nicoなどのように、大手企業がmastodonインスタンスを提供し始めています。 それぞれは独自の拡張を行い、魅力を高めています。 mastodonそのものはAGPLのため、改変したソースコードが入手できるようにする必要がありますが、その一覧があったらいいかなと思ってまとめることにしました。 とは言え、私が知っているのはごく一部。もしみかけたら @chsh@bookn.me へのメンションにてお知らせください。

インスタンス

提供会社(団体・個人) インスタンスURL ソースコードURL 本家masterからの差分 追加日
ピクシブ 🐘 https://pawoo.net/ :octocat: pixiv/mastodon/tree/pawoo 📊 2017/4/23
@chsh
chsh / get_docker_container_ip.sh
Created April 16, 2017 07:45
How to get docker container ip.
CONTAINER_ID=`docker ps -q`
IP=`docker inspect --format="{{ .NetworkSettings.IPAddress }}" $CONTAINER_ID`
@chsh
chsh / array_ext.rb
Last active March 30, 2017 22:29
Dimensional repeat executor.
#
# usage: [2,2,2].times { |i,j,k| do something... }
#
class Array
def times(&block)
raise unless block_given?
return nil if empty?
dim_call__(nil, self, &block)
end
@chsh
chsh / Flat UI Colors.clr
Last active December 19, 2023 15:22
Some color pallets with Apple Color List (.clr) format
@chsh
chsh / responsivle_mediaqueries.sass
Created February 24, 2017 01:16
Responsive Media Queries example from "bulma"
// Responsiveness
$tablet: 769px !default
// 960px container + 40px
$desktop: 1000px !default
// 1152px container + 40
$widescreen: 1192px !default
// 960 and 1152 have been chosen because
// they are divisible by both 12 and 16
978321500014
978321500021
978321500038
978321500045
978321500052
978321500069
978321500076
978321500083
978321500090
978321500106
@chsh
chsh / create_open_bds.rb
Last active January 12, 2021 22:44
Crawl all data using openBD API
class CreateOpenBds < ActiveRecord::Migration
def change
create_table :open_bds do |t|
t.string :isbn, null: false
t.jsonb :content
t.datetime :last_crawled_at
t.timestamps null: false
end
add_index :open_bds, :isbn, unique: true
add_index :open_bds, :content, using: :gin