- 「きをつけよう」は意味ない
- 実装、プラクティス、プロセスに落とし込む
- コードレビュー
- 二人で作業
- テストケース
#!/bin/perl | |
#$str = $_; | |
#$str =~ s/\[SQL\]/\033\[1;36m$&\033\[0m/g; | |
#$str =~ s/INSERT.+\n/\033\[1;32m$&\033\[0m/g; | |
#$str =~ s/SELECT.+\n/\033\[1;33m$&\033\[0m/g; | |
#print $str; | |
use strict; | |
use warnings; | |
while(<>) { |
# config data | |
#dir_path = '/home/hogemoge/' | |
# change dir | |
Dir.chdir(dir_path) | |
p Dir.pwd | |
analyze = Hash.new | |
Dir.open(dir_path).each_with_index do |f, index| |
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
def save_image(url, index) | |
suffix = 'jpg' if url.index('jpg') || url.index('jpeg') | |
suffix = 'png' if url.index('png') | |
suffix = 'gif' if url.index('gif') | |
open("/tmp/desktop#{index}.#{suffix}", 'wb') do |file| | |
open(url) do |data| |
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'rest_client' | |
url = "http://localhost:5000/upload_file" | |
filename = File.expand_path('./test.jpg', File.dirname(__FILE__)) | |
f = File.new(filename, "rb") |
$ -> | |
setTimeout -> | |
$('#notice').faceOut 'slow', | |
800 |
# あらかじめ「config/enviroments.rb」に | |
# Tilt::CoffeeScriptTemplate.default_bare = true | |
$ -> | |
setTimeout( | |
-> $('#notice').fadeOut('slow') | |
800 | |
) |
//-------------------------------------------------------------------------------- | |
#pragma mark - | |
#pragma mark GestureRecognizer | |
//-------------------------------------------------------------------------------- | |
// scale image depending on users pinch gesture | |
- (void)handlePinchGesture:(UIPinchGestureRecognizer *)recognizer | |
{ | |
NSLog(@"-------------------------------"); | |
NSLog(@"%s", __FUNCTION__); | |
NSLog(@"scale = %f", recognizer.scale); |
(function() { | |
var methodMap = { | |
'create': 'POST', | |
'update': 'PUT', | |
'delete': 'DELETE', | |
'read' : 'GET' | |
}; | |
var getUrl = function(object) { | |
if (!(object && object.url)) return null; |
# ./logs/ディレクトリの中にあるaccess_logのデータをDBに入れるだけの処理 | |
require 'mysql2' | |
require 'active_record' | |
# | |
# query | |
# | |
def query(sql) | |
my = Mysql2::Client.new(:host => "localhost", :username => "root", :password => '', :database => 'web_analyze') | |
my.query("set character set utf8") |