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
SELECT | |
b.id, | |
b.brandname, | |
COUNT(*) | |
FROM | |
gamelist g | |
INNER JOIN brandlist b | |
ON g.brandname= b.id | |
GROUP BY | |
b.id |
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
SELECT | |
to_char(g.sellday, 'YYYY') "year", | |
g.sellday, | |
g.gamename, | |
g.median | |
FROM gamelist g | |
INNER JOIN ( | |
SELECT | |
to_char(g2.sellday, 'YYYY') "year", | |
MAX(g2.median) "median" |
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
SELECT | |
c.name, | |
COUNT(*) | |
FROM createrlist c | |
INNER JOIN shokushu s | |
ON c.id = s.creater | |
INNER JOIN gamelist g | |
ON g.id = s.game | |
INNER JOIN userreview_with_tag uwt | |
ON g.id = uwt.game |
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
SELECT | |
to_char(g.sellday, 'YYYY') "year", | |
SUM(CASE a.title WHEN 'Nscripter' THEN 1 ELSE 0 END) "Nscripter", | |
SUM(CASE a.title WHEN '吉里吉里' THEN 1 ELSE 0 END) "吉里吉里" | |
FROM attributelist a | |
INNER JOIN attributegroupsboolean ag | |
ON a.id = ag.attribute | |
INNER JOIN gamelist g | |
ON g.id = ag.game | |
WHERE |
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
SELECT | |
g.sellday, | |
g.gamename, | |
COUNT(u.game) "count" | |
FROM gamelist g | |
INNER JOIN userreview u | |
ON g.id = u.game | |
WHERE | |
g.sellday > to_date('2000', 'YYYY') | |
GROUP BY |
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
describe User do | |
let(:user) { FactoryGirl.create :user } | |
before { user.fizz_buzz! } | |
# 実行結果で副作用があるので、それのテスト | |
it { expect(user.name).to eq 'fizz_buzz' } | |
it { expect(user.age).to be_nil } | |
# has_many の関連先が消えている事の確認 | |
it { expect(user.friendships).to be_blank } | |
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
import webbrowser | |
import tweepy | |
""" | |
Query the user for their consumer key/secret | |
then attempt to fetch a valid access token. | |
""" | |
class CacooOAuthHandler(tweepy.OAuthHandler): | |
def _get_oauth_url(self, endpoint, secure=False): |
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
from random import getrandbits | |
from time import time | |
import hmac, hashlib | |
import sys | |
import urllib | |
import urllib2 | |
import urlparse | |
# build parameters to post | |
consumer_key = 'your <consumer_key>' |
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 | |
cmd="git" | |
tmp_file="$TEMP/gitcmd.sh" | |
nkf -w << EOF > $tmp_file | |
#!/bin/sh | |
$cmd $* | |
EOF | |
chmod +x $tmp_file |
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 | |
if [ -n "`git diff`" ] | |
then | |
git stash save --keep-index | |
git stash apply --index | |
fi |
OlderNewer