Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
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 |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for:
# -*- coding: utf-8 -*- | |
module SomeModule | |
def self.included(klass) | |
klass.send(:include, SomeModule::Methods) | |
klass.send(:extend, SomeModule::ClassMethods) | |
end | |
module Methods |
% 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)>' |
#!/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クラス使えば行ける。この関数は不要 |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "charfb.h" | |
static int block_char_map[] = { | |
0x0020, | |
0x2598, | |
0x259d, | |
0x2580, | |
0x2596, |
S3_BUCKET = 'xxx' | |
AWS_SECRET_KEY = 'xxx' | |
AWS_ACCESS_KEY_ID = 'xxx' | |
# アクセスしてきたクライアントにS3へアップロードするためのpolicyと | |
# それをハッシュ化したsignatureを返す。 | |
def policies | |
# 0. セッションの確認など | |
# 1. 画像情報をバリデーションする |
// | |
// lirc_web | |
// v0.0.4 | |
// Alex Bain <[email protected]> | |
// | |
// Requirements | |
// | |
var lirc_node = require('lirc_node'), | |
consolidate = require('consolidate'), |
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]; |