Skip to content

Instantly share code, notes, and snippets.

View linyows's full-sized avatar

Tomohisa Oda linyows

View GitHub Profile
@mizzy
mizzy / Rakefile
Last active August 29, 2015 13:55
require "bundler/gem_tasks"
require "bundler/gem_helper"
require 'rspec/core/rake_task'
require 'octokit'
Octokit.configure do |c|
c.login = `git config --get github.user`.strip
c.access_token = `git config --get github.token`.strip
end
require 'logger'
class RakeExcecuter < Logger::Application
def initialize(tasklist = [])
super
@tasklist = tasklist
end
private
def run
@buty4649
buty4649 / gen_rrd_nighttime.sh
Created June 19, 2014 10:41
1年前からの日付からRRDを生成。6~19時は0、それ以外は1を書き込む
#!/bin/sh
rrdtool create nighttime.rrd -b $(date -d "1 years ago" +%s) DS:night:GAUGE:600:0:U RRA:MAX:0.5:1:576 RRA:MAX:0.5:6:432 RRA:MAX:0.5:24:540 RRA:MAX:0.5:288:450
perl -MRRDs -e '
$e=time;
$s=$e-3600*24*365;
while($s<=$e) {
$d=($s + 9 * 3600)%(24 * 3600);
if($d >= (19 * 3600) || $d <= (6 * 3600)) {
@hikarock
hikarock / gist:818b67c91e98fd74929f
Created August 17, 2014 10:49
rendr-examplesメモ

rendr-examplesを眺めてみたメモ。

00. simple

基本的な構成。npm install & grunt serverhttp://localhost:3030で起動する(以下のexampleも同様)。

01. config

00ではindex.jsに直接書かれていたdataAdapterConfig/configディレクトリ内のファイルに分離。 NODE_ENVの値で本番/開発環境の設定ファイル切り替えを行う

@smellman
smellman / kyoten.geojson
Created July 9, 2015 06:17
kyoten: 東京都水道局 震災時の給水拠点
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
module MultiParameterAttributes
def filter_time(attributes, name)
attrs = attributes.collect do |key, value|
if key =~ /^#{Regexp.escape(name.to_s)}\((\d+)(\w)\)$/
[$1.to_i, value.send("to_#$2")]
end
end.compact.sort_by(&:first).map(&:last)
Time.zone.local(*attrs) unless attrs.empty?
end
@atestu
atestu / gist:887268
Created March 25, 2011 17:53
Sends socket.io messages to the server writing on the S3 account using the knox library for node.js
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Alexandre Testu">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
@guybrush
guybrush / nodeconf_2011.md
Created May 6, 2011 07:22
a list of slides from nodeconf 2011
@hotchpotch
hotchpotch / cocproxy.nginx.conf
Created May 25, 2011 04:50
cocproxy for nginx
#!nginx -p . -c cocproxy.nginx.conf
error_log /dev/stderr debug;
daemon off;
events {
worker_connections 48;
}
http {
@kyanny
kyanny / diff-A.txt
Created June 28, 2011 13:13
git diff --diff-filter option
.../test/fixtures/test/scoped_translation.erb | 1 +
actionpack/test/fixtures/test/translation.erb | 1 +
.../test/connections/jdbc_jdbcderby/connection.rb | 18 ++++++++
.../test/connections/jdbc_jdbch2/connection.rb | 18 ++++++++
.../test/connections/jdbc_jdbchsqldb/connection.rb | 18 ++++++++
.../test/connections/jdbc_jdbcmysql/connection.rb | 26 +++++++++++
.../connections/jdbc_jdbcpostgresql/connection.rb | 26 +++++++++++
.../connections/jdbc_jdbcsqlite3/connection.rb | 25 ++++++++++
.../test/connections/native_db2/connection.rb | 25 ++++++++++
.../test/connections/native_firebird/connection.rb | 26 +++++++++++