Skip to content

Instantly share code, notes, and snippets.

@bzz0217
bzz0217 / syousetu_narou_api.html
Created September 13, 2016 18:33
小説家になろう APIリクエスト jsonp読み込み+vue.js
<!DOCTYPE html>
<html>
<head>
<title>小説家になろう APIリクエスト</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div>
<ul id="app">
@bzz0217
bzz0217 / view.php
Created June 5, 2016 05:11
Qiita - 言語別投稿数推移
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title>言語別推移</title>
@bzz0217
bzz0217 / qiita_lang_post_transition.php
Created June 5, 2016 05:10
Qiita - 言語別投稿数推移
<?php
require 'vendor/autoload.php';
ORM::configure('mysql:host=localhost;dbname=qiita');
ORM::configure('username', 'xxxx');
ORM::configure('password', 'xxxx');
$sql = "SELECT CASE WHEN ( `title` like '%php%' OR `body` like '%php%' ) THEN 'PHP'
WHEN ( `title` like '%ruby%' OR `body` like '%ruby%' ) THEN 'Ruby'
WHEN ( `title` like '%python%' OR `body` like '%python%' ) THEN 'Python'
@bzz0217
bzz0217 / StrCount_Test.js
Last active May 21, 2016 05:52
文字数測定[改]テスト
function TestStrCount() {
//サロゲートベア文字+全角
assert.strictEqual(StrCount.str_count_sum("𠮷野家"), 3);
//サロゲートベア文字
assert.strictEqual(StrCount.str_count_sum("𡈽𡌛𡑮𪚲𪘚"), 5);
//半角
assert.strictEqual(StrCount.str_count_sum("abcdefg"), 3.5);
//\r
assert.strictEqual(StrCount.str_count_sum("\r"), 1);
//改行
@bzz0217
bzz0217 / StrCount.js
Last active May 21, 2016 06:04
文字数測定[改]
// 文字数測定
var StrCount = {
//改行
line: 1,
//全角
em: 1,
//半角
em_half: 0.5,
//4バイト文字
surrogate: 1,
@bzz0217
bzz0217 / strwidth.html
Created May 16, 2016 15:47
10文字で丸める / 文字数を測定
<!DOCTYPE html>
<html>
<head>
<title>文字列を丸める</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-2.2.3.min.js" integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=" crossorigin="anonymous"></script>
<script src="./jquery.ry.js"></script>
<script>
/*
@bzz0217
bzz0217 / view.php
Created May 7, 2016 17:40
動画ダウンローダ - フロントエンド
<?php
//ini_set("display_errors", 1);
//error_reporting(-1);
ini_set("max_execution_time", 0);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>動画ダウンロード</title>
@bzz0217
bzz0217 / youtube_dl_run_progress.php
Created May 7, 2016 17:38
動画ダウンローダ - youtube-dlで動画をサーバに保存・進捗状況を出力
<?php
/*
* youtube-dlコマンド実行と進捗状況の取得
*/
class youtube_dl_run_progress{
//外部コマンド設定
public static $config = array(
'time' => '',
'output_path' => '',
'url' => ''
@bzz0217
bzz0217 / youtube_dl_get_info.php
Created May 7, 2016 17:36
動画ダウンローダ - youtube-dlで動画情報を取得
<?php
/*
* youtube-dlコマンド 動画情報取得
*/
class youtube_dl_get_info {
private $info;
/*
<?php
header("Content-Type: text/html; charset=UTF-8");
require_once 'get_csv.php';
$filepath = "./euc.csv";
$from_encoding = "EUC";
$gc = new get_csv($filepath, $from_encoding);
$csv = $gc->csv_array_convert();