Skip to content

Instantly share code, notes, and snippets.

View takano32's full-sized avatar
🌏

TAKANO Mitsuhiro takano32

🌏
View GitHub Profile
@oquno
oquno / テスト.mkd
Created July 10, 2012 03:09
アンドロイドアプリからテスト

画像

@tinbotu
tinbotu / script.rb.diff
Created August 14, 2012 14:43
fixing Gyazoed image scale with Macbook Pro Retina grows twice
--- /Applications/Gyazo.app/Contents/Resources/script~ 2012-08-14 07:50:01.000000000 +0900
+++ /Applications/Gyazo.app/Contents/Resources/script 2012-08-14 23:31:39.000000000 +0900
@@ -24,6 +24,7 @@
else
system "screencapture -i \"#{tmpfile}\""
if File.exist?(tmpfile) then
+ system "/usr/local/bin/mogrify -resize 50% -unsharp 1x1.2+0.2+0 \"#{tmpfile}\""
system "sips -d profile --deleteColorManagementProperties \"#{tmpfile}\""
end
end
@tinbotu
tinbotu / gist:3694056
Created September 10, 2012 21:34
Squid's external acl problem
squid の external acl を perl で書いてたんだけどあるときから exteranal acl daemon 自体が起動しなくなった
2012/09/11 05:33:15| externalAclLookup: 'authed_ext' queue overload (ch=0x2300e300)
とか出る。Overload もなにも、1個のURLにアクセスしただけでコイツが発生するので、何それと思ってちょっとまえのログ見たら
2012/09/11 06:04:23| helperOpenServers: Starting 1/1 'perl' processes
2012/09/11 06:04:23| commBind: Cannot bind socket FD 7 to [::1]: (99) Cannot assign requested address
2012/09/11 06:04:23| commBind: Cannot bind socket FD 8 to [::1]: (99) Cannot assign requested address
2012/09/11 06:04:23| ipcCreate: Failed to create child FD.
2012/09/11 06:04:23| WARNING: Cannot run '/usr/bin/perl' process.

MessagePack-Python and msgpack-string-ext

Background of Python

Python 2

Python 2 には strunicode の2種類の文字列型がある。

@esehara
esehara / config.example.yaml
Last active December 14, 2015 22:39
郵便物検索結果の状態を取ってきて吐き出すスクリプト
config:
color: true
goods:
- URL: http://tracking.post.japanpost.jp/service/detail_search.do?searchKind=M004&reqCode=HOGEHOGE123
kind: 健康かつ快活になれる海外サプリメント
@esehara
esehara / setogiwa_match.txt
Last active December 16, 2015 14:39
瀬戸際のマーチさん
瀬戸際に漂う 神秘のソース
このライブラリの果ては まあるく結合してますよ
瀬戸際で語らう リリースの形
七つのチケットはブロッカーを出してる
仕様ー!どこだー!
仕様ー!どこだー!
import re
from saying.exceptions import ApplicationException
from itertools import chain
class DSLSyntaxError(ApplicationException):
pass
def format(handler, text, message):
var = {
u'sender': lambda: resolve_handle(message.Sender.Handle),
@yuryu
yuryu / hostsbench.c
Created August 22, 2013 10:20
name lookup benchmark
#define _POSIX_C_SOURCE 199309L
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <memory.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
@mopemope
mopemope / core.clj
Last active December 21, 2015 18:59
hentai4.me crawler example
(ns hentai.core
(:require
[clojure.core.async :as async :refer :all])
(:use
[hentai.crawler]
[clojure.tools.logging]))
(defn- zip [a b]
(map (fn [x y] (vector x y)) a b))
# -*- coding: utf-8 -*-
try:
import bisect
except:
pass
def main():
(num_items, num_days) = map(int, raw_input().split())
prices = sorted(int(raw_input()) for n in xrange(num_items))