Skip to content

Instantly share code, notes, and snippets.

View okumin's full-sized avatar

okumin okumin

View GitHub Profile
@okumin
okumin / bulk.md
Last active August 29, 2015 14:06
Bulk insert into Redis

Bulk insert into Redis

script

import java.io.File
import java.io.PrintWriter
import io.gatling.redis.util.RedisHelper

def generateList(): Unit = {
<?php
require_once "twitteroauth/twitteroauth/twitteroauth.php";
$client = new TwitterOauth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
$next_cursor = -1;
$target = "";
$f = fopen("./hogehoge.txt", "w");
while($next_cursor != 0) {
for($i = 0 ; $i < 5; $i++) {
@okumin
okumin / unionfind.py
Created September 15, 2012 13:30
Union find
# -*- coding: utf-8 -*-
class UnionFind:
def __init__(self):
self.refs = {}
def find(self, x):
if x in self.refs:
ref = self.find(self.refs[x])
self.refs[x] = ref
@okumin
okumin / FeedParser
Created August 12, 2012 19:17
フィードをパースするクラス
<?php
/**
* Copyright (c) 2012 okumin, http://okumin.com/
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to