Skip to content

Instantly share code, notes, and snippets.

@tarky
tarky / gist:8488ecc39c1d34f6bbe0
Created June 22, 2015 04:56
limit column by hirb
> extend Hirb::Console
=> main
> table User.last(10), fields: [:id, :name]
User Load (1.5ms) SELECT `users`.* FROM `users` ORDER BY `users`.`id` DESC LIMIT 10
+----+----------------+
| id | name |
+----+----------------+
| 63 | chany0u |
| 64 | ae06710 |
| 65 | ps_lain_bot |
@tarky
tarky / gist:6c68c018ea4f7133ac26
Created May 26, 2015 05:16
Use of unresolved identifier
/Users/araky/Documents/development/ios/GourmetSearch2/GourmetSearch/ShopMapDetailViewController.swift:23:22: Use of unresolved identifier 'shop'
なぜかTarget Membershipで〜〜Tests側にチェックが入ってると出るエラー。

#Overview

When you push Like button at a SNS, haven't you felt being just diplomatic instead of expressing your true sense of value? For example, when one of your coleagues share some music which is a kind of you don't like, have you experienced pushing Like button of the post reluctantly?

At Vond.me, you don't have to act like this, because vond.me uses Vote button instead of Like button. On Vote button system, there is a strong premise that each participant is expected to express one's sense of value.

@tarky
tarky / gist:e8fdaacd53bc850b5eb0
Created May 22, 2015 07:10
Vond説明日本語

#Vondとは?

SNSでLikeボタンを押すときに、本当に良いと思っていないのに、社交辞令で押している ことはありませんか?例えば、同僚があなたの好きではない音楽をシェアていた時に、 しぶしぶLikeボタンを押した経験はありませんか?

Vondでは、そのような社交辞令をする必要がありません。なぜならVondはLikeではなく、 Voteを採用しており、参加者は心から好きなものにVoteするという前提があるから です。

@tarky
tarky / gist:0be96b063b17551f8888
Created May 11, 2015 07:10
data sql with column name.
mysqldump --no-create-info --complete-insert -u root inq_development >noddl.sql
Theme.all.order(id: :asc).each do |theme|
theme.create_activity(created_at: theme.created_at, updated_at: theme.updated_at, user: theme.user)
theme.entries.order(id: :asc).each do |entry|
entry.create_activity(created_at: entry.created_at, updated_at: entry.updated_at, user: entry.user)
entry.votes.order(id: :asc).each do |vote|
unless entry.user == vote.user
vote.create_activity(created_at: vote.created_at, updated_at: vote.updated_at, user: vote.user)
end
end
end
@tarky
tarky / gist:fb16bcf704db4b09257f
Created April 6, 2015 10:36
foreign key error
u.destroy
(0.2ms) BEGIN
Authentication Load (0.5ms) SELECT `authentications`.* FROM `authentications` WHERE `authentications`.`user_id` = 5
SQL (2.3ms) DELETE FROM `authentications` WHERE `authentications`.`id` = 4
Twitter Load (3.2ms) SELECT `twitters`.* FROM `twitters` WHERE `twitters`.`id` = 3 LIMIT 1
SQL (1.7ms) DELETE FROM `twitters` WHERE `twitters`.`id` = 3
Follow Load (0.3ms) SELECT `follows`.* FROM `follows` WHERE `follows`.`user_id` = 5
Activity Load (0.4ms) SELECT `activities`.* FROM `activities` WHERE `activities`.`trackable_id` = 16 AND `activities`.`trackable_type` = 'Follow' LIMIT 1
Feed Load (1.0ms) SELECT `feeds`.* FROM `feeds` WHERE `feeds`.`activity_id` = 40
Notification Load (0.4ms) SELECT `notifications`.* FROM `notifications` WHERE `notifications`.`activity_id` = 40
@tarky
tarky / gist:3a08411a694eabe0b60e
Last active August 29, 2015 14:18
tmux operation
C-b space (bound to next-layout by default) cycles through available layouts, you can also use the select-layout command.
M-1 to M-5 Arrange panes in one of the five preset layouts: even-
horizontal, even-vertical, main-horizontal, main-
vertical, or tiled.
On OS X, M is Esc, i.e. Ctrl-b Esc-1.
See man tmux for more details.
http://superuser.com/questions/493048/how-to-convert-2-horizontal-panes-to-vertical-panes-in-tmux
@tarky
tarky / gist:8118f7e2606a8c3c09af
Created April 3, 2015 04:14
How to scroll in tmux
http://superuser.com/questions/209437/how-do-i-scroll-in-tmux
@tarky
tarky / gist:328e5be7d6274618878d
Created March 29, 2015 10:13
tmux chat sheet
https://gist.github.com/andreyvit/2921703