Skip to content

Instantly share code, notes, and snippets.

from selenium import webdriver
from time import sleep
import sys
sn = sys.argv[1]
pw = sys.argv[2]
driver = webdriver.Firefox()
driver.get('http://fmcp.jp/?utm_source=fmcojp')
driver.find_element_by_id('agreement').click()
driver.find_element_by_class_name('twoBtn').find_element_by_tag_name('input').click()
<?php
require './lib/TwistOAuth.php';
//endpoint https://api.twitter.com/1/account/generate.json
$num = 19;
$sn_base = '****';
$password = "****";
$shift = 1;
// 既存の
@elzup
elzup / cal.php
Created December 17, 2014 09:02
PHPでカレンダー出力 ref: http://qiita.com/elzup/items/66a51dad716536aff159
<?php
$col_width = 3;
$title_format = '-*- Y-m -*-';
// 引数がない場合は今月
$ts = strtotime("first day of");
if (isset($argv[2])) {
$ts = strtotime("first day of {$argv[1]}-{$argv[2]}");
}
list($y, $m, $t, $w) = explode(',', date('Y,m,t,w', $ts));
@elzup
elzup / file2.txt
Created December 17, 2014 12:51
PHPで競技プログラミングのデバッグテンプレート ref: http://qiita.com/elzup/items/3a3e05d959b3db338bac
----- 0 -----
40
[0.01884ms]
----- 1 -----
600
[0.00381ms]
----- 2 -----
@elzup
elzup / file0.js
Created December 28, 2014 14:27
GoogleMapAPI のヒートマップの色を変える ref: http://qiita.com/elzup/items/5767dde93cec16724a72
var heatmap = new google.maps.visualization.HeatmapLayer({
fillOpacity: 1.1,
radius: 50,
gradient: ['#fff', '#f00', '#f80', '#8f0', '#0f0', '#0f8', '#08f', '#00f', '#80f', '#f08', 'black']
});
heatmap.setData(point);
heatmap.setMap(map);
statuses/mentions_timeline
statuses/user_timeline
statuses/home_timeline
statuses/retweets_of_me
statuses/retweets/:id
statuses/show/:id
statuses/destroy/:id
statuses/update
statuses/retweet/:id
statuses/update_with_media
<?php
/* 1 */
$kuji = ['大吉', '小吉', '吉', '凶'];
for ($i = 0; $i < 10000000; $i++) {
echo $kuji[array_rand($kuji)] . PHP_EOL;
}
// /\v(大吉\n){11}
<?php
/*
* TwitterAPI1.1 url snippets 生成
*/
require_once('./simple_html_dom.php');
/*【保存版】TwitterAPI1.1 REST API 全項目解説 | DX.univ */
$url = 'http://dx.24-7.co.jp/twitterapi1-1-rest-api/';
$html = file_get_html($url);
snippet statuses/home_timeline
abbr 自分のホームタイムラインツイート一覧を取得
options word
statuses/home_timeline
snippet statuses/mentions_timeline
abbr 自分のメンション付きツイート一覧を取得
options word
statuses/mentions_timeline
@elzup
elzup / bingo.py
Last active August 29, 2015 14:12
# -*- coding: utf-8 -*-
u"""BINGO の確立をシミュレーションするスクリプト
input:
times = 抽選機を回す回数, card_num = カードの数
outpu:
1本でも揃う確立
"""
import sys