Skip to content

Instantly share code, notes, and snippets.

View tondol's full-sized avatar

tondol tondol

View GitHub Profile
@tondol
tondol / instagram.rb
Created December 18, 2015 18:31
Instagramをいい感じに
require 'pp'
require 'watir-webdriver'
directory = File.dirname($0)
config = YAML.load_file(directory + "/config.yml")
USERNAME = ARGV.shift
def instagram(username, password)
browser = Watir::Browser.new :phantomjs
@tondol
tondol / twitter.rb
Last active December 18, 2015 18:32
特定アカウントのツイートIDを全件取得する
require 'nokogiri'
require 'pp'
require 'watir-webdriver'
SCREEN_NAME = ARGV.shift
FROM_OLDEST = Date.new(2011, 1, 1)
MY_EMAIL = "foo"
MY_PASSWORD = "barbaz"
@browser = Watir::Browser.new :chrome
@tondol
tondol / gyao.rb
Created December 2, 2015 17:59
GyaoのチャンネルURLからいい感じのコマンドを出力する
# -*- coding: utf-8 -*-
require 'net/https'
require 'pp'
# https://gist.github.com/cielavenir/a858255c4009ecbb9b67
@channel_urls = ARGV
@player_urls = []
puts "カドカワ".split("").zip("ドワンゴ".split("")).map(&:sample).join
@tondol
tondol / chikuwa1.png
Last active August 29, 2015 14:17
#やまぐちくわ姫
chikuwa1.png
@tondol
tondol / kssn.coffee
Last active August 29, 2015 14:15
kssn.coffee
request = require 'request'
cheerio = require 'cheerio'
module.exports = (robot) ->
robot.respond /kssn/i, (msg) ->
url = "http://www.eventernote.com/actors/3562"
options =
url: url
timeout: 2000
headers: {'user-agent': 'eventernote scraper'}
@tondol
tondol / lovelive.coffee
Last active August 29, 2015 14:15
lovelive.coffee
# Description
# A Hubot script for shoda script
#
# Configuration:
# None
#
# Commands:
#
# Author:
# tondol
@tondol
tondol / okome.coffee
Last active August 29, 2015 14:15
okome.coffee
# Description
# A Hubot script for shoda script
#
# Configuration:
# None
#
# Commands:
#
# Author:
# tondol
@tondol
tondol / exaudio.sh
Created December 27, 2014 17:25
ffmpegを使ってオーディオデータを抽出するalias
# exaudio hoge.mp4 hoge.m4a
function exaudio() {
~/Documents/00scripts/ffmpeg -i $1 -vn -acodec copy $2
}
# exm4a *.mp4
# *.mp4.m4aが出力される
function exm4a() {
while [ "$1" != "" ]
do
@tondol
tondol / g.c
Created December 7, 2014 16:38
CODE THANKS FESTICAL 2014 G問題
#include <stdio.h>
#include <stdlib.h>
double probs[100];
double table[101][200][200]; // N,K,K
int main(void) {
int i, j, k;
int N, K;
scanf("%d%d",&N,&K);