Skip to content

Instantly share code, notes, and snippets.

View kk6's full-sized avatar
🐾
Playing with my cat.

kk6 kk6

🐾
Playing with my cat.
View GitHub Profile
def test():
print('Hello Gist!!')
# coding:utf-8
# ANS-progのurl:http://answer.pythonpath.jp/questions/248/
# 「よく使う/全然使わない標準モジュールはなんですか?」
# で名前の上がっているよく使われている標準モジュールTOP10
# 今は数が少ないので手計算でもいいけどCounter使ってみたかったので。
import collections
with open('commonly-used-modulelist.txt', 'r') as load_file:
items = [item.strip('\n') for item in load_file.readlines()]
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document
domain("google.com"),
domain("google.co.jp")
{
/* To hide profile photo */
#gbi4i, #gbmpi, .a-c-T,
.a-b-Rf-Lz, .a-f-VitKP,
.a-f-i-q {
@kk6
kk6 / google-style.css
Created July 2, 2011 17:33
Googleのナビゲーションバーを固定するユーザースタイル
@namespace url(http://www.w3.org/1999/xhtml);
/*
* Google User Style
* This style is to fixed of Google's top bar.
*/
@-moz-document domain("google.com"), domain("google.co.jp") {
#gb {
position: fixed;
width: 100%;
top: -1px;
// ==UserScript==
// @name MyPixiv
// @namespace http://d.hatena.ne.jp/kk6/
// @description とりあえずお知らせがうざかったので。
// @include http://www.pixiv.net/*
// @require https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js
// ==/UserScript==
(function ($) {
// News at main contents
var newstop = $("div.NewsTop");
// ==UserScript==
// @name MyPixiv
// @namespace http://d.hatena.ne.jp/kk6/
// @description とりあえずお知らせを隠す機能だけ。
// @include http://www.pixiv.net/*
// ==/UserScript==
(function ($) {
var news = $('.NewsTop > h1, .adver_Rightcolumn + .area_right > .area_rightSpace');
news.next().hide();
news.click(function () {
@kk6
kk6 / get-all-text.py
Created July 30, 2011 13:49
英単語カウンター。なんか色々おかしい(´・ω・`)
#! /usr/bin/env python
#-*- coding:utf-8 -*-
import re
import urllib2
import contextlib
import collections
from pyquery import PyQuery as pq
#-*- coding:utf-8 -*-
"""
This script compare a package installed by pip and the latest version
in PyPI. And it is also possible to upgrade it then and there.
For now work on Windows and Linux.
And I'm not MACer.(Probably run.)
require: Python 2.6, 2.7 or 3.x
If you using Python 2.5 or below, check at gist:1153625
@kk6
kk6 / pip_version_check_for_py25.py
Created August 18, 2011 08:04
gist: 1153590 のPython 2.5以下用
#-*- coding:utf-8 -*-
"""
This script compare a package installed by pip and the latest version
in PyPI. And it is also possible to upgrade it then and there.
For now work on Windows and Linux.
And I'm not MACer.(Probably run.)
"""
from pip import get_installed_distributions, call_subprocess
@kk6
kk6 / fizzbuzz.py
Created September 16, 2011 10:40
無駄にitertoolsを駆使したFizzBuzz(Python3では動きません)
#-*- coding:utf8 -*-
# 無駄にitertoolsを駆使したFizzBuzz
from itertools import repeat, ifilterfalse, starmap, count
N = 31
LEN = range(1, N)
FIZZ, BUZZ = map(repeat, ("Fizz", "Buzz"))
fizz, buzz = (