Skip to content

Instantly share code, notes, and snippets.

View CodeIQ's full-sized avatar

CodeIQ CodeIQ

View GitHub Profile
@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
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:3863315
Created October 10, 2012 05:24
Find Memory Leaks
//
// MemoryLeakTestTableViewController.m
// MemoryLeakTest
@interface MemoryLeakTestTableViewController : UITableViewController
{
NSMutableArray *dataForCellArray1;
}
@property (retain, nonatomic) NSMutableArray *dataForCellArray2;
@property (retain, nonatomic) NSMutableArray *dataForCellArray3;
@CodeIQ
CodeIQ / clock.py
Created October 10, 2012 02:17 — forked from vkgtaro/clock.py
CodeIQ 用問題
# -*- coding: utf-8 -*-
import sys
import time
import datetime
class Observable():
pass
class Tick(Observable):