Skip to content

Instantly share code, notes, and snippets.

View kymmt90's full-sized avatar

Kōhei Yamamoto kymmt90

View GitHub Profile
@exoer
exoer / db_server.rb
Created July 4, 2011 17:58 — forked from coderanger/db_server.rb
Create postgres users and databases from Chef
include_recipe "postgresql::server90"
# inspiration from
# https://gist.github.com/637579
execute "create-root-user" do
code = <<-EOH
psql -U postgres -c "select * from pg_user where usename='root'" | grep -c root
EOH
command "createuser -U postgres -s root"
@udzura
udzura / LICENSE
Last active May 8, 2021 14:23
やわらかRuby
やわらかRubyはCC BY 4.0 で提供します。
詳細: https://creativecommons.org/licenses/by/4.0/deed.ja
This work is licensed under a Creative Commons Attribution 4.0 International License.
See also: https://creativecommons.org/licenses/by/4.0/deed
@gaspanik
gaspanik / rvm2rbenv-setup.markdown
Last active June 7, 2018 23:23
RVMからrbenvに移行した手順まとめ

RVMからrbenvへの移行(OS X 10.8.x)

(注意)既にRVMを使ってRubyがインストール済みなので、OS X標準のRubyではなくHomebrewを使って別バージョンのRubyをインストールするまでのもろもろの準備は省いています。その部分が必要であれば、このあたりの記事の前段が参考になるかもしれません(Rails OS X Developer Guide)。

RVMのアンインストール

まずは、RVMをアンインストールしましょう。

$ rvm implode
@JunichiIto
JunichiIto / alias_matchers.md
Last active May 14, 2024 08:48
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@baboocon
baboocon / kyodoku.rb
Created April 25, 2015 06:59
読書メーターにログイン状態でアクセスし、お気に入りユーザーの読書状況を一括取得するRubyスクリプト
# -*- coding: utf-8 -*-
require 'mechanize'
require 'nokogiri'
require 'kconv'
module HashInitializable
def initialize(attributes={})
attributes.each do |name,value|
send("#{name}=",value)
end
@azu
azu / js.md
Last active December 28, 2021 07:19
JavaScriptのレベル別書籍のまとめ

前提: 完成していて、比較的支持を集めていて、JavaScriptを中心にした書籍 (DOM APIよりは言語を中心とした内容)

追記: JavaScriptの入門書 #jsprimerを書いている

最初からES2015で学ぶことを前提にした初心者〜中級者向けのJavaScript本がなかったので書いてる。 ES2015でJavaScriptという言語のコア部分は大きく変わったので、それを前提とした内容にする予定。

@hamakn
hamakn / 0.yokohamarb_memos.index.md
Last active December 4, 2016 08:55
Yokohama.rbのメモ

Yokohama.rbのメモ

何なんすかこの文章(群)

  • Yokohama.rbであの時何やったっけ、を思い出しやすくするためのメモ
  • 次回行ってみようと思うけど何やってるかわからないや... というニーズに応えられると良いなぁ

Index

@PharaohKJ
PharaohKJ / init.el
Created June 14, 2016 08:02
textlint for emacs flycheck
;; ref https://github.com/amperser/proselint/issues/37
;; textlint
(flycheck-define-checker textlint
"A linter for prose."
:command ("textlint" "--format" "unix" "--rule" "no-mix-dearu-desumasu" "--rule" "max-ten" "--rule" "spellcheck-tech-word" source-inplace)
:error-patterns
((warning line-start (file-name) ":" line ":" column ": "
(id (one-or-more (not (any " "))))
(message (one-or-more not-newline)
(zero-or-more "\n" (any " ") (one-or-more not-newline)))
@hardvain
hardvain / list.rs
Created January 30, 2018 16:02
Singly Linked List in Rust
use std::fmt::*;
/// A struct that represents a single node in a list
///
/// # State
/// * `element` - The element of type T that is stored in the node
/// * `next` - An optional value that points to the next element in the list
#[derive(PartialEq, Debug)]
pub struct Node<T: Debug> {
pub element: T,