Skip to content

Instantly share code, notes, and snippets.

@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@mattn
mattn / README.md
Last active February 8, 2024 04:58
blacklist/whitelist master/slave に関する情報集め

blacklist/whitelist master/slave に関する情報集め

blacklist/whitelist、master/slave という単語は相応しくないという意見に OSS がどの様に対応すべきかを自身で考える為の情報集めです。見つけ次第、逐次更新していきます。

僕(mattn) 自身は black lives matter に同意をしています。blacklist/whitelist、master/slave という単語を廃止する事が、歴史的背景を持たない文化圏では特定の意味を持たなかった為、個人的には若干思う所はありますが、廃止自身に反対するつもりはありません。

昔から、主副を表す物には master/slave という単語が使われてきました。ハードディスクの IDE、仮想端末(pty)、色々あります。またネットワークの IP フィルタリングに関しては blacklist/whitelist と表記した物が今でも沢山あります。

我々日本人が意識せずに使っていた blacklist/whitelist、master/slave という単語が、人々にどの様に影響しうるのか、今後 OSS としてどの様に関わっていけば良いかを理解する上で、自分なりの情報集めをしたいと思っています。

@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@raysan5
raysan5 / rguiicons_making_of_diary.md
Last active December 4, 2023 12:53
rGuiIcons Making Of Diary

rGuiIcons Making Of Diary

In this post I'm explaining the creation process for my latest tool rGuiIcons. It took me 7 days from tool design to release and I'm listing here how I lived it.

NOTE: I'm adding some details of my life during those days to better illustrate the time management and development, I think it could be interesting for the readers to see the big picture of it.

Introduction

Earlier this year, by January-February, I decided to add a new feature to raygui, my immediate-mode gui library, I added icons support. I was in the process of developing some tools and I realized that custom icons could really make a difference and make the tools look way better.

@sknjpn
sknjpn / TinyCamera2D
Created July 10, 2017 14:28
Camera2Dと同様に使えるカメラ。サンプル付き。
# include <Siv3D.hpp> // OpenSiv3D v0.1.5
struct TinyCamera2D
{
TinyCamera2D() = default;
void update()
{
const Transformer2D t1(Mat3x2::Translate(-sRegion.pos).scale(Window::Size().y / sRegion.size.y), true);
//描画領域をマウスホイールで操作する
dRegion = dRegion.scaledAt(Cursor::PosF(), 1 + Mouse::Wheel() / 10.0);
@obelisk68
obelisk68 / class_reference.rb
Created May 2, 2017 11:17
Created by RubyPico at Tue May 02 20:17:08 2017
def main
loop do
name = choise(class_list, combine: true)
clear
puts Module.const_get(name).info
puts
choise(["戻る"])
clear
@ssugiyama
ssugiyama / poppo.rb
Created December 12, 2016 10:29
あめの数から最大限進化可能な回数を求める
def poppo(candies, n=12)
evolutions = (candies/n).to_i
rest = evolutions *2 + candies%n
evolutions += poppo(rest) if rest >= n
evolutions
end
# https://developer.github.com/v3/gists/#create-a-gist
TOKEN = "XXXXXX"
def new_gist(filename, content)
json = {
# description: "Created by RubyPico at #{Time.now}",
public: true,
files: {
filename => {
content: content
TOKEN = "XXXXXX"
def post(message)
Browser.post(
"https://notify-api.line.me/api/notify",
header: { "Authorization" => "Bearer #{TOKEN}" },
body: { message: message }
)
end

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.