Skip to content

Instantly share code, notes, and snippets.

View bz0's full-sized avatar

(・(ェ)・) bz0

  • japan
View GitHub Profile
@bz0
bz0 / composer.json
Last active February 11, 2017 02:52
csvのローカルダウンロード(JIS第3・第4水準の文字化け対策・Volcanus_Csvライブラリを利用)
{
"require": {
"volcanus/csv": "^1.1"
}
}
<html>
<head>
<title>TODO</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
<script>
$(function(){
function task_generate($self){
//タスクを追加
@bz0
bz0 / FailedOpenFileException.php
Last active September 30, 2017 15:28
CSV(SJIS)読込クラスです。
<?php
class FailedOpenFileException extends Exception
{
public function __construct($message) {
parent::__construct($message);
}
}
@bz0
bz0 / gaViewProfile.php
Last active October 9, 2017 07:09
GoogleAnalyticsAPIで、ビュー情報を取得する(ウェブサイトのURL・サイト名を取得する)
<?php
class gaViewProfile{
public $clientId;
public $privateKey;
public $viewId;
public function __construct($clientId, $viewId, $privateKeyFilePath){
$this->clientId = $clientId;
$this->viewId = $viewId;
$this->privateKeyRead($privateKeyFilePath);
@bz0
bz0 / tweet.js
Last active October 21, 2017 03:16
twitter.comでコンソールからツイートを実行する
var input = "test"; //入力内容
var div = document.querySelector("div#tweet-box-home-timeline div");
div.innerText = input;
var button = document.querySelector("button.tweet-action");
button.disabled = "";
button.click();
@bz0
bz0 / index.js
Created November 5, 2017 16:00
chatworkAPIでメッセージを送信します。(ES6 / Google Apps Script)
import rooms from './rooms'
const room_id = [room id]; //https://www.chatwork.com/#!rid[room id]
const token = "[chatwork api token]";
global.messages = function () {
let cw = new rooms(room_id, token);
let body = "test";
cw.messages(body);
}
@bz0
bz0 / kintone.php
Last active November 10, 2017 16:37
kintoneクライアント(レコード操作のみ)簡易版 作成中
<?php
class client{
public static $config;
public function method(){
switch(strtoupper(self::$config['method'])){
case 'GET':
$req = new get(self::$config);
break;
case 'POST':
@bz0
bz0 / parser.ts
Last active December 16, 2017 14:13
typescriptで書くpukiwikiパーサ
class Inline {
private match = {
strong: /^''([\s\S]+?)''(?!')/,
em: /^'''((?:[^_]|__)+?)'''(?!')/,
br: /^~(?:\n|$)|^(&br;)/,
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
}
private out: string;
private renderer: Renderer;
@bz0
bz0 / README.md
Last active January 6, 2018 14:30
slackにメッセージを通知する

promise

tscコンパイル前に、promiseも変換できるようにtsconfig.json内に 「es2015.promise」を追記します。

"lib" : ["es2015", "es2015.iterable", "dom", "es2015.promise"]

その後、tscを実行して下さい。