Skip to content

Instantly share code, notes, and snippets.

sdfsdffd
@t-kuni
t-kuni / カード情報取得
Created September 21, 2017 17:23
シャドバのカード情報を取得する
var name = $("#form_title").val().replace("の評価と採用デッキ", "")
var rarity = $(".sv_text_info tr:nth-child(3) a").text().replace("(一覧)", "")
var clazz = $(".sv_text_info tr:nth-child(4) a").text().replace("(一覧)", "")
var kind = $(".sv_text_info tr:nth-child(5) td").text()
var stat = $(".sv_status h3:nth-child(1) div").text().split(" ")
var cost = stat[0]
var atk = ""
var def = ""
if (stat.length > 1) {
atk = stat[1];
@t-kuni
t-kuni / follow.js
Last active December 2, 2018 12:09
ツイッターの検索結果(ツイート一覧)のユーザをまとめてフォローする
// ツイートにマウスオーバーしてプロフィールを表示させる
function focusTweet() {
$tweet = this;
return new Promise(function(resolve, reject) {
$avatar = $tweet.find("img.avatar");
$avatar.mouseover();
resolve($tweet);
});
}
@t-kuni
t-kuni / unfollow.js
Last active December 2, 2018 13:50
フォロバされてないフォローを外す
/**
* フォロバックしてないフォロワーを外す
*/
function wait() {
return new Promise(function(resolve) {
setTimeout(function() {
resolve();
}, 1000);
@t-kuni
t-kuni / collectResultsInNostalgia.js
Last active February 25, 2018 13:48
ノスタルジアの楽曲データ画面の情報を収集する
var musics = $(".cl_music_data");
musics.each(function() {
var music = $(this);
var seq = music.find('.cl_music_data_seq').text();
var title = music.find('.cl_music_data_title').text();
if (!title) return;
var level = getScore(seq, "level");
@t-kuni
t-kuni / AmazonProductAdvertisingAPI-JavaScriptExample.js
Last active March 11, 2018 00:09
JavaScriptからAmazon Product Advertising APIを叩くときのサンプルです。URLの構築まで(後はajaxでGETで飛ばせば結果が得られる)。CryptoJSとjQueryに依存してます。
// Your Access Key ID, as taken from the Your Account page
var access_key_id = ""; // TODO 埋める
// Your Secret Key corresponding to the above ID, as taken from the Your Account page
var secret_key = ""; // TODO 埋める
// The region you are interested in
var endpoint = "webservices.amazon.co.jp";
var uri = "/onca/xml";
@t-kuni
t-kuni / twitter_fav.js
Last active December 3, 2018 12:18
TwitterのTLをいいねするスクリプト
/**
* 検索結果(ツイート一覧)のツイートすべてにいいねする
*/
function wait() {
return new Promise(function(resolve) {
setTimeout(function() {
resolve();
}, 1000);
});
public function buildTestCases($variations) {
$iterate = function($variations, $depth = 0, $indexies = []) use (&$iterate) {
$keys = array_keys($variations);
if ($depth >= count($keys)) {
yield $indexies;
} else {
$key = $keys[$depth];
for ($i = 0; $i < count($variations[$key]); $i++) {
$val = $variations[$key][$i];
function myFunction() {
var issues = [];
var offset = 0;
do {
var fetchedIssues = fetchIssues(offset);
Array.prototype.push.apply(issues, fetchedIssues);
offset += 100;
} while (fetchedIssues.length == 100);
writeHeader();
<?php
namespace App\Xxx;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* Class HasOneCustomResolver