Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# chkconfig: - 85 15
# description: fluentd daemon
# Source function library.
. /etc/rc.d/init.d/functions
# parameter
shell=/bin/bash
@j138
j138 / gist:6279424
Last active December 21, 2015 08:39
yahoo画像検索結果をajaxで読み込み、正規表現でパースし、Arrayにくっこむ。
// ==UserScript==
// @name test
// @namespace test
// @description test
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function() {
// var user_name = document.hoge_form.user_input.value;
var user_name = '島風';
@j138
j138 / gist:8277603
Created January 6, 2014 03:05
centos6.4へfleutnd+elasticsearchのインストール
# rpmでfleutndのインストール
curl -L http://toolbelt.treasuredata.com/sh/install-redhat.sh | sh
# elasticsearchプラグインのインストール
/usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-elasticsearch
@j138
j138 / crawl-google-image.rb
Last active August 29, 2015 13:57
Googleイメージ検索で出てくるサムネイル画像収集
#!/usr/local/bin/ruby
# coding: utf-8
require 'net/http'
require 'uri'
require 'openssl'
require 'digest/md5'
require 'nokogiri'
# ================================
# TODO: seeq txt
<?xml version="1.0"?>
<opencv_storage>
<cascade>
<size>
24 24</size>
<stages>
<_>
<trees>
<_>
<_>
<?xml version="1.0"?>
<opencv_storage>
<cascade type_id="opencv-haar-classifier">
<size>
24 24</size>
<stages>
<_>
<trees>
<_>
<_>
#!/usr/bin/env ruby
require 'opencv'
include OpenCV
# if ARGV.size != 1
# puts 'Usage: ruby #{__FILE__} Image'
# exit
# end
@j138
j138 / imgur-tweetbot-custom-api.php
Created April 2, 2014 04:05
imgur-tweetbot-custom-api
<?php
// access and get api key
// chose :authorized_type -> Anonymus usage without user authorization
// https://api.imgur.com/oauth2/addclient
// plz input ur api_id
$client_id = 'plz-input-urapi-id';
if (!$_POST) exit('post plz');
@j138
j138 / imgur-tweetbot-custom-api.php
Created April 2, 2014 04:39
imgur-tweetbot-custom-api.php
<?php
// access and get api key
// chose :authorized_type -> Anonymus usage without user authorization
// https://api.imgur.com/oauth2/addclient
// plz input ur api_id
$client_id = 'plz-input-urapi-id';
if (!$_POST) exit('post plz');
$file = file_get_contents($_FILES['media']['tmp_name']);
$url = 'https://api.imgur.com/3/image.json';
$headers = array("Authorization: Client-ID $client_id");
@j138
j138 / jubatus_smpl.rb
Last active August 29, 2015 14:01
新艦娘XXXの大きさ予測
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
host = '127.0.0.1'
port = 9199
name = 'test'
require 'jubatus/classifier/client'
client = Jubatus::Classifier::Client::Classifier.new(host, port, name)