Skip to content

Instantly share code, notes, and snippets.

View CodeIQ's full-sized avatar

CodeIQ CodeIQ

View GitHub Profile
<!DOCTYPE html>
<html xmlns:og="http://ogp.me/ns#">
<head>
<meta charset="utf-8" />
<title>Coder IQ|フロントエンジニアのための実務スキル評価サービス</title>
<meta name="description" content="自分のフロントエンジニアとしての能力や市場価値の可視化って難しい。CodeIQで、企業の第一線で活躍するエンジニアによる実践的な問題に挑戦!" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta property="og:title" content="Coder IQ|フロントエンジニアのための実務スキル評価サービス" />
<meta property="og:description" content="Coder IQで、企業の第一線で活躍するフロントエンジニアによる実践的な問題に挑戦!" />
@CodeIQ
CodeIQ / company_user.rb
Created December 7, 2012 02:02 — forked from grooves/company_user.rb
Question 3
# coding: utf-8
class CompanyUser < ActiveRecord::Base
attr_accessible :user_id, :company_id, :position
attr_accessible :user_id, :company_id, :position, :is_admin, as: :admin
end
@CodeIQ
CodeIQ / concern.rb
Created December 7, 2012 01:59 — forked from grooves/concern.rb
Question 1
# coding: utf-8
class Concern < ActiveRecord::Base
belongs_to :publication
end
@CodeIQ
CodeIQ / concern.rb
Created December 5, 2012 04:27 — forked from grooves/concern.rb
Question 1
# coding: utf-8
class Concern < ActiveRecord::Base
belongs_to :publication
end
@CodeIQ
CodeIQ / gist:4117416
Created November 20, 2012 11:34
20121122_1
//
// MemoryLeakTestTableViewController.m
// MemoryLeakTest
#import "ASIHTTPRequest.h"
@interface MemoryLeakTest2ViewController : UITableViewController
{
NSMutableArray *_dataForCellArray0;
}
System.out.print(new SmartArray(new String[] { "Hello", "World!", "Java" })
.map(new SmartArray.Op<String, Integer>() {
public Integer op(String s) {
return s.length();
}
})
.max());
print [ "Hello", "World!", "Ruby" ].map{|e| e.length }.max
@CodeIQ
CodeIQ / gist:3903758
Created October 17, 2012 04:48
20121025_1
CREATE TABLE IF NOT EXISTS t_order (order_id int(5) NOT NULL AUTO_INCREMENT, product_id int(5) NOT NULL, order_date date NOT NULL, PRIMARY KEY (order_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=21;
INSERT INTO t_order (order_id, product_id, order_date) VALUES
(1, 1, '2012-09-01'),(2, 1, '2012-09-01'),(3, 2, '2012-09-01'),(4, 3, '2012-09-03'),(5, 3, '2012-09-03'),
(6, 2, '2012-09-03'),(7, 1, '2012-09-11'),(8, 2, '2012-09-11'),(9, 1, '2012-09-14'),(10, 3, '2012-09-15'),
(11, 1, '2012-09-16'),(12, 2, '2012-09-16'),(13, 2, '2012-09-16'),(14, 3, '2012-09-16'),(15, 3, '2012-09-16'),
(16, 3, '2012-09-16'),(17, 1, '2012-09-20'),(18, 2, '2012-09-20'),(19, 3, '2012-09-30'),(20, 2, '2012-10-01');
CREATE TABLE IF NOT EXISTS t_product ( product_id int(5) NOT NULL AUTO_INCREMENT, product_name varchar(10) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL, PRIMARY KEY (product_id)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
INSERT INTO t_product (product_id, product_name) VALUES (1, 'プランA'), (2, 'プ
@CodeIQ
CodeIQ / gist:3871397
Created October 11, 2012 10:06
20121022_2
mysql> desc SALES;
+----------------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------+------+-----+---------+-------+
| SALES_DATE | date | YES | MUL | NULL | |
| SALES_VOLUME | int(11) | YES | | 0 | |
| SALESPERSON_ID | int(11) | NO | PRI | NULL | |
+----------------+---------+------+-----+---------+-------+
mysql> desc SALESPERSON;
@CodeIQ
CodeIQ / gist:3871386
Created October 11, 2012 10:04
20121022_1
<?php
/**
* セプテーニ営業実績登録スクリプト
*/
// 今月の営業マン別売上情報
$SALES_DATA = array(
array('salesperson_id'=>1, 'salesperson_name'=>"佐藤", 'sales_volume'=>20000000),
array('salesperson_id'=>2, 'salesperson_name'=>"武藤", 'sales_volume'=>8900000),
array('salesperson_id'=>3, 'salesperson_name'=>"瀬戸口", 'sales_volume'=>50000000),