Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@iZRIdJJ53S
iZRIdJJ53S / デプロイ、構成管理ツールまとめ
Created July 28, 2013 06:26
デプロイツール、構成管理ツールと呼ばれているツール群のまとめ。2013年7月
Ruby製
Puppet
http://puppetlabs.com/
http://gihyo.jp/admin/serial/01/puppet
Capistrano
https://github.com/capistrano/capistrano/wiki
http://ja.wikipedia.org/wiki/Capistrano
Chef
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active January 3, 2025 03:54
5 entertaining things you can find with the GitHub Search API
@clicube
clicube / 0_icon_to_140.md
Last active February 27, 2024 01:05
アイコンを140文字にする話

アイコンを140文字にする話

なに?

この前ドット絵のアイコン書いたんですよ、こんなの。

@kyubing

結構うまくできたかなって満足してます。

@murayama
murayama / module_sample.rb
Created July 9, 2013 01:50
rubyでモジュールを作るときの賢いやり方
# -*- coding: utf-8 -*-
module SomeModule
def self.included(klass)
klass.send(:include, SomeModule::Methods)
klass.send(:extend, SomeModule::ClassMethods)
end
module Methods
@maoe
maoe / irb-session.txt
Last active December 19, 2015 04:38
Require order problem with active_support/core_ext/date_time and core_ext/date
% irb
irb(main):001:0> gem 'activesupport', '4.0.0'
=> true
irb(main):002:0> require 'active_support/core_ext/date_time'
=> true
irb(main):003:0> require 'active_support/core_ext/date'
TypeError: superclass mismatch for class DateTime
from /opt/rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /opt/rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /opt/rbenv/versions/1.9.3-p448/lib/ruby/1.9.1/date.rb:3:in `<top (required)>'
@kimoto
kimoto / det.rb
Last active December 18, 2015 07:29
行列式の計算練習するためのツール
#!/bin/env ruby
# encoding: utf-8
#
# Rubyで行列式の計算練習しまくるためのツール
# ruby ./det.rb で起動
#
# Author: kimoto
# http://ja.wikipedia.org/wiki/%E3%82%AF%E3%83%A9%E3%83%A1%E3%83%AB%E3%81%AE%E5%85%AC%E5%BC%8F
# 正直Rubyなら、標準で入ってるMatrixクラス使えば行ける。この関数は不要
@moriyoshi
moriyoshi / charfb.c
Last active December 17, 2015 23:59
#include <stdio.h>
#include <stdlib.h>
#include "charfb.h"
static int block_char_map[] = {
0x0020,
0x2598,
0x259d,
0x2580,
0x2596,
@yuku
yuku / file0.rb
Last active December 17, 2015 18:40
Qiitaの画像アップロード機能も簡単に実装できる。そう、S3ならね。 ref: http://qiita.com/yuku_t/items/40b7daf018d3dab48974
S3_BUCKET = 'xxx'
AWS_SECRET_KEY = 'xxx'
AWS_ACCESS_KEY_ID = 'xxx'
# アクセスしてきたクライアントにS3へアップロードするためのpolicyと
# それをハッシュ化したsignatureを返す。
def policies
# 0. セッションの確認など
# 1. 画像情報をバリデーションする
@taiyoh
taiyoh / client.js
Last active December 17, 2015 17:49
lirc_webにつなぎっぱにしてイベントを待つプロセス
//
// lirc_web
// v0.0.4
// Alex Bain <[email protected]>
//
// Requirements
//
var lirc_node = require('lirc_node'),
consolidate = require('consolidate'),
@taiyoh
taiyoh / app.js
Last active December 17, 2015 17:49
lirc_webのapp.jsの一部をこんな感じで書き換えた
app.get('/api/stream', function(req, res) {
console.log('connection catched');
var sock = req.socket;
conns[sock.fd] = sock;
res.on('close', function() {
delete conns[sock.fd];
console.log('disconnected: ' + Object.keys(conns).join(", "));
});
sock.on('close', function() {
delete conns[sock.fd];