Skip to content

Instantly share code, notes, and snippets.

View skyriser's full-sized avatar

Shin-ichi Ueda skyriser

View GitHub Profile
@sue445
sue445 / rubocop_auto_correct_commit.rb
Last active April 17, 2018 07:36
`rubocop --auto-correct --only COP` and `git commit`
# `rubocop --auto-correct --only COP` and `git commit`
# Usage: ruby rubocop_auto_correct_commit.rb
require "json"
DEFAULT_ORDER = 100
# --auto-correctする時の実行順(数字が小さい方が先に実行される)
COP_ORDERS = {
# Style/UnneededPercentQはStyle/StringLiteralsのようにシングルクオーテーション優先かダブルクオーテーション優先のようなconfigがない
@blueberrystream
blueberrystream / iptables.md
Last active March 8, 2016 08:58
秘伝のタレ iptables味

iptables設定

方針

  • inboundは基本drop
  • forwardはdrop
  • outboundはaccept
  • inboundでacceptするのは以下
    • ループバックインタフェースへのinbound
    • ICMP
    • 送信元がNTP(udp123)で送信先がNTP(udp123)
    • 送信先がSSH(tcp22) ※ステートフル性を確認
@esamattis
esamattis / application.html.erb
Last active May 19, 2019 00:36
React hot reloading with Webpack for Ruby on Rails
<script charset="utf-8">
<% if ENV["RAILS_ENV"] == "production" %>
var script = "/react-app-bundle.js";
<% else %>
console.warn("Development mode. Make sure to start 'node devServer.js'");
var script = "http://" + (location.host || 'localhost').split(':')[0] + ":4000/react-app-bundle.js"
<% end %>
document.write('<script src="' + script + '"></' + 'script>');
</script>
@blueberrystream
blueberrystream / solarized-dark_putty.ini
Created February 10, 2015 05:47
putty.iniに書くSolarized Dark色設定
Colour0="131,148,150"
Colour1="147,161,161"
Colour2="0,43,54"
Colour3="7,54,66"
Colour4="0,43,54"
Colour5="238,232,213"
Colour6="7,54,66"
Colour7="0,43,56"
Colour8="220,50,47"
Colour9="203,75,22"
@mathieue
mathieue / sentinel
Created February 4, 2013 16:19
redis sentinel startup script
#!/bin/bash
### BEGIN INIT INFO
# Provides: redis sentinel
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts redis sentinel
# Description: Starts redis sentinel using start-stop-daemon
### END INIT INFO
@yaakaito
yaakaito / gist:4601150
Last active December 17, 2019 06:58
「Githubのせいで留年しました」
参考:http://www.itmedia.co.jp/news/articles/1205/18/news091.html
「わたし、Githubのせいで留年したんです」――こう話すのは、都内の私立大学に通うHogeさん(21・仮名)。Githubのほか、Bitbucket、SourceForge、stackoverflowなど複数のツールを使ってきたHogeさん。今年4月、Hogeさんにとって2回目の大学2年生が始まった。
HogeさんがGithubを始めたのは大学に入学した2010年。それまでもstackoverflowなどのSNSを利用していたが「stackoverflowは外人とのディスカッション中心で、Githubはライブラリの公開がメイン」と、環境の変化に合わせて使用するSNSを変えてきた。
stackoverflowではコメントなどを通じた外人とのコミュニケーションが中心だったが、Githubでは「新しいのプッシュされてる、アップデート決定」「あのIssue、今日なんか進捗あった?」「このPullRequestマージしたらごはん食べよう」「今夜ハッカソンやるけど誰か来たい人!」――など、自分と直接関係がない情報でも、リアルタイムに更新される全てのフィードが気になった。
どんな時も、Githubを開けば必ず誰かが何かをCommitしている。その面白さに夢中になり、気付けば毎日、暇さえあればコミットログを追うようになっていた。自分でも多い日には1日に100回以上CommitをPushし、満員電車でPCが開けず、Wifiにつながりにくい時などは、Pushがうまくできないことにいら立った。
@haruta
haruta / chatwork-to-all-helper.user.js
Created November 30, 2012 05:50
チャットワークで "@@" "@@" をチャンネル全員のTOに置き換えるchromeのユーザースクリプト
// ==UserScript==
// @name chatwork to all helper
// @match https://www.chatwork.com/*
// @version 1.1
// ==/UserScript==
(function(){
document.getElementById('cw_chattext').addEventListener('blur', function(e){
if (/[@@]{2}/.test(e.target.value)) {
var to_list = [];
var imgs = document.getElementById('cw_mention_gallery').getElementsByTagName('img');
@teppeis
teppeis / tenkaichi-git.md
Last active April 29, 2023 14:58
天下一gitconfig大会

天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisの資料です。

ぎっとぎとにしてやんよ

DojoCat

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
#!/bin/bash
hoge="#"
if [ $hoge!="#" ]; then
echo "hoge is not # (1st)"
fi
if [ "$hoge " != "# " ]; then
echo "hoge is not # (2nd)"
fi
@nono
nono / blowfish.rb
Created June 26, 2012 10:57
How to encrypt and decrypt Blowfish in Ruby 1.9 with https://github.com/drench/blowfish.js
#!/usr/bin/env ruby
require "openssl"
class BF < Struct.new(:key, :pad_with_spaces)
def encrypt(str)
cipher = OpenSSL::Cipher.new('bf-ecb').encrypt
if pad_with_spaces
str += " " until str.bytesize % 8 == 0
cipher.padding = 0