Skip to content

Instantly share code, notes, and snippets.

@sj26
sj26 / LICENSE.md
Last active November 6, 2024 21:56
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@jmblog
jmblog / gist:6077993
Last active November 22, 2021 08:37
所得税と住民税の計算方法

所得税(国税)

所得税の計算方法

所得税額 = (所得金額(A) - 所得控除額(B)) × 税率 - 税額控除額(C)

  • 「所得金額(A)- 所得控除額(B)」は 課税所得金額 といい、1,000円未満の端数を切り捨てる。

所得税の税率

@jpetazzo
jpetazzo / README.md
Last active September 30, 2022 05:36
Share a directory with a docker container

Rectifier

The diode bridge is the simplest rectifier I know.

Rectifier lets you share a directory with a docker container (just like $yourvm shared folders).

You don't have to install anything in your containers, and you only need to install diod in the host. diod is packaged on Ubuntu/Debian distros, and will automatically be apt-get install-ed if needed.

Since it uses diod to make a bridge, I called it rectifier. Yeah, that sucks, so if you have a better name, I'll steal it!

@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
@lanius
lanius / install_gitorious.sh
Created April 19, 2011 06:03
Gitorious Installation to Ubuntu Server 10.04
# Gitorious Installation to Ubuntu Server 10.04
# from gitorious mainline:
# commit e2e70edd42ac1c00dab518d61d566ee3fec929db
# Author: Marius Mathiesen <[email protected]>
# Date: Wed Apr 13 11:43:07 2011 +0200
: << '#COMMENT_OUT'
Ubuntu Server 10.04 に Gitorious をインストールしたときのメモ。
@cowboyd
cowboyd / JenknsCI JRuby Meeting Details.mdown
Created March 28, 2011 14:28
Meeting Details for Jenkins + JRuby

JenkinsCI Ruby Plugins

Date: Every Thursday, from Thursday, January 5, 2012 to no end date Time: 10:00 am, Central Standard Time (Chicago, GMT-06:00) Meeting Number: 336 439 792 Meeting Password: (This meeting does not require a password.)

nnoremap <Space>gn :<C-u>w<CR>:Git now<CR>
nnoremap <Space>gN :<C-u>w<CR>:Git now --all<CR>
@koseki
koseki / Capfile
Created April 22, 2010 06:45
Capistrano without Rails
# この行を追加。デフォルトだと-fでCapfileを指定したときにエラーになる。
Dir.chdir(File.dirname(__FILE__))
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks