- ダッシュボード
- 何も考えずに各モデルをカウントするのでレコード件数増えるとえらいことになる。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/setup' | |
require 'tapp' | |
class Operator | |
def initialize(left, right) | |
@left = left | |
@right = right | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global prevIpValue | |
set prevIpValue to "" | |
on idle | |
set newIpValue to IPv4 address of (get system info) as string | |
if newIpValue = "192.168.1.80" and not newIpValue = prevIpValue then | |
try | |
display alert "NASをマウントします" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CacheByRequest | |
def self.read(key) | |
if Thread.current[:cache_by_request] | |
Thread.current[:cache_by_request].read(key) | |
else | |
raise "before CacheByRequest::Store initialization" | |
end | |
end | |
def self.write(key, val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @param [Hash] options Any of :log, :env, :pwd, :command, :stdout_log, :stderr_log, :spawn_options, :spawn_checker, :timeout | |
def spawn_process(options = {}) | |
env = options[:env] || {} | |
command = options[:command] | |
stdout_log = options[:stdout_log] ? [options[:stdout_log], 'w'] : :out | |
stderr_log = options[:stderr_log] ? [options[:stderr_log], 'w'] : :err | |
pwd = options[:pwd] | |
spawn_options = { | |
:out => stdout_log, | |
:err => stderr_log, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
require 'rspec-power_assert' | |
class Point | |
attr_reader :row, :col | |
def initialize(row, col) | |
@row, @col = row, col |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pp' | |
BASE_TABLE = [ | |
%w(a b c d e), | |
%w(f g h i j), | |
%w(k l m n o), | |
%w(p q r s t), | |
%w(u v w x y), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp = require('gulp') | |
plumber = require('gulp-plumber') | |
util = require('gulp-util') | |
sass = require('gulp-ruby-sass') | |
rimraf = require('gulp-rimraf') | |
uglify = require('gulp-uglify') | |
minifyCSS = require('gulp-minify-css') | |
streamify = require('gulp-streamify') | |
size = require('gulp-size') | |
tap = require('gulp-tap') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Guardable | |
def initialize(obj) | |
@obj = obj | |
end | |
def method_missing(method_name, *args, &block) | |
return @obj if @obj.nil? | |
@obj.send(method_name, *args, &block) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# 自分のコミットが少ない順にファイルを並べる | |
# Display all files sorted in the order your commit less | |
# output | |
# total[TAB]add[TAB]del[TAB]filename | |
while getopts "a:n:" OPT; do | |
case $OPT in |