Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

MISAWA Yoshihiro PyYoshi

🏠
Working from home
View GitHub Profile
@PyYoshi
PyYoshi / ParallelCurl.php
Last active Aug 29, 2015
[PHP] curlでお手軽並列リクエストするやつ
View ParallelCurl.php
<?php
/**
* Class ParallelCurl
* @author PyYoshi aka Yoshihiro Misawa
* @license MIT
*/
class ParallelCurl
{
View bench_chardet.py
#!/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 Feb 5, 2014
Twitter Bootstrap 3上でSCEditorを利用する際にボタンが潰れてデザインが崩れてしまう問題を修正する。
View sceditor.patch.bootstrap.css
.sceditor-button {
box-sizing: content-box;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
}
View OAuthHttpClientStack.java
public class OAuthHttpClientStack extends HttpClientStack {
private final OAuthConsumer consumer;
public OAuthHttpClientStack(HttpClient client, OAuthConsumer consumer) {
super(client);
this.consumer = consumer;
}
@Override
View devise.ja.yml
#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 Aug 29, 2015
Ghostをnode.js cluster上で動かす奴。
View README.md

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

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

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

node ./app.js
@PyYoshi
PyYoshi / socket.io.d.ts
Created Mar 24, 2014
オレオレ定義ファイル
View socket.io.d.ts
// 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');
View msgpack_renderer.rb
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
View php_json.txt
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
View MsgpackPacker.php
<?php
use Fluent\Logger\Entity;
use Fluent\Logger\PackerInterface;
class MsgpackPacker implements PackerInterface
{
/**
* pack entity as a msgpack format.
You can’t perform that action at this time.