Skip to content

Instantly share code, notes, and snippets.

View PyYoshi's full-sized avatar
🌍
Working from The World

MISAWA Yoshihiro PyYoshi

🌍
Working from The World
View GitHub Profile
@PyYoshi
PyYoshi / ParallelCurl.php
Last active August 29, 2015 13:55
[PHP] curlでお手軽並列リクエストするやつ
<?php
/**
* Class ParallelCurl
* @author PyYoshi aka Yoshihiro Misawa
* @license MIT
*/
class ParallelCurl
{
#!/usr/bin/env python
# coding: utf-8
import chardet
import time
def main():
do_times = 10
path = r"wikipediaJa_One_Thousand_and_One_Nights_SJIS.txt"
with open(path, 'rb') as f:
@PyYoshi
PyYoshi / sceditor.patch.bootstrap.css
Created February 5, 2014 09:19
Twitter Bootstrap 3上でSCEditorを利用する際にボタンが潰れてデザインが崩れてしまう問題を修正する。
.sceditor-button {
box-sizing: content-box;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
}
public class OAuthHttpClientStack extends HttpClientStack {
private final OAuthConsumer consumer;
public OAuthHttpClientStack(HttpClient client, OAuthConsumer consumer) {
super(client);
this.consumer = consumer;
}
@Override
#forked from https://gist.github.com/orzccc/3104030
ja:
devise:
confirmations:
confirmed: 'アカウントを登録しました。'
send_instructions: '登録方法を数分以内にメールでご連絡します。'
send_paranoid_instructions: 'もしあなたのEメールアドレスが見つかった場合、本人確認についてのメールが数分以内に送られます。'
failure:
already_authenticated: '既にログインしています。'
@PyYoshi
PyYoshi / README.md
Last active August 29, 2015 13:57
Ghostをnode.js cluster上で動かす奴。

Ghostをnode.js cluster上で動かす奴

DBはMySQLかPostgreSQLを使いましょう。

app.jsをghostをインストールしたディレクトリと同じ場所に置いて

node ./app.js
@PyYoshi
PyYoshi / socket.io.d.ts
Created March 24, 2014 08:46
オレオレ定義ファイル
// Type definitions for socket.io
// Project: http://socket.io/
// Definitions by: William Orr <https://github.com/worr>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Modified by PyYoshi <myoshi321go@gmail.com>
///<reference path='../node/node.d.ts' />
declare module "socket.io" {
import http = require('http');
Mime::Type.register 'application/x-msgpack', :msgpack
# レンダラにmsgpackを追加
ActionController::Renderers.add :msgpack do |data, options|
send_data data.to_msgpack, :type => 'application/x-msgpack'
end
PHP Version: 5.5.12
Json Version: ext/json 1.2.1
Count: 262962
Encode in 0.02131 sec, 1039144 bytes
Decode in 0.07157 sec
Json Version: pecl/jsonc 1.3.5
Count: 262962
Encode in 0.02531 sec, 1039144 bytes
<?php
use Fluent\Logger\Entity;
use Fluent\Logger\PackerInterface;
class MsgpackPacker implements PackerInterface
{
/**
* pack entity as a msgpack format.