Skip to content

Instantly share code, notes, and snippets.

View kkeeth's full-sized avatar
🎨
riotjs book in japanese publish!!

Keeth Kuwahara kkeeth

🎨
riotjs book in japanese publish!!
View GitHub Profile
@kkeeth
kkeeth / qiita_org_items.py
Created December 1, 2023 07:18
Qiita organization 記事一覧取得スクリプト
import requests
import csv
from datetime import datetime
# Qiita APIの基本URLと組織の名前
base_url = "https://qiita.com/api/v2"
organization_name = "yumemi" # ここに組織名を設定
# 現在の年を取得
current_year = datetime.now().year
@kkeeth
kkeeth / connpass.js
Created August 16, 2023 12:34
connpass の特定の organization の開催勉強会のデータ集計
// Connpass API のリファレンス
// https://connpass.com/about/api/
const axios = require("axios");
const fs = require("fs");
const ORGANIZATION_ID = "1657"; // ここに organization の ID を入力.1657 はゆめみ社のもの
const RESULTS_PER_PAGE = 100; // Connpass API の最大結果数
async function fetchEventsByOrganization(organizationName, start = 1) {
@kkeeth
kkeeth / aws_labmda_indexhtml_redirect.js
Last active August 6, 2020 03:14
Lambda@Edge の index.html のリダイレクト
'use strict';
// ref. https://qiita.com/GussieTech/items/3ae77dbcb1e79222a9bc
const SUFFIX = '/index.html';
const REGEX_SUFFIX_LESS = /\/[^/.]+$/;
const APPEND_TO_DIRS = 'index.html';
const REGEX_TRAILING_SLASH = /.+\/$/;
exports.handler = (event, context, callback) => {
let request = event.Records[0].cf.request;
const requestUri = request.uri
if (requestUri.match(REGEX_SUFFIX_LESS)) {
@kkeeth
kkeeth / lambda_basic_auth.js
Created August 6, 2020 03:09
Lambda@Edge で Basic 認証を実装
'use strict';
exports.handler = (event, context, callback) => {
// Get request and request headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Configure authentication
const authUser = 'pre_release';
const authPass = 'hello_world';
// Construct the Basic Auth string
const authString = 'Basic ' + new Buffer(authUser + ':' + authPass).toString('base64');
// then-catch-final(then)
const taskA = () => {
console.log("Task A")
throw new Error("throw Error at taskA")
}
const taskB = () => {
console.log("Task B") // does not be call
}
const onRejected = (error) => {
console.error(error) // => "throw Error at taskA"
@kkeeth
kkeeth / queries_mutations.gql
Last active February 22, 2020 23:52
GraphQL queries and mutations on GitHub API v4 explorer
# get repository information
query GetRep {
repository(name: "riot", owner: "riot") {
id
name
url
}
}
# get user information
const readline = require('readline')
const reader = readline.createInterface({
input: process.stdin,
output: process.stdout
})
reader.on('line', line => {
if (line !== "fin") {
console.log(line)
@kkeeth
kkeeth / crypt-ctr.js
Created October 10, 2019 22:36
encrypt decrypt sample js with moment
const crypto = require('crypto')
const moment = require('moment')
const algorithm = 'aes-256-cbc'
const password = "xrandom-password-length-32-chars"
const iv = 'random-length-16'
const hash = encrypt('hoge')
function encrypt(text){
const cipher = crypto.createCipheriv(algorithm,password,iv)
text += `\$${moment().unix()}`
@kkeeth
kkeeth / todo-2019.md
Last active January 7, 2019 16:45
2019年やることリスト

2019年に学びたい技術、読んでみたい本、完成させるGitHubリポジトリなどをピックアップ。
随時追加・更新する予定。 ※最終更新日:2019/01/05

Technology

技術名 進捗 備考
(ざっくり)デザインの理論 未着手
(ざっくり)経営論 未着手
(ざっくり)組織論 着手
Laravel 着手 主にAPI開発、テスト
@kkeeth
kkeeth / todo-2018.md
Last active January 5, 2019 13:52
2018年やることリスト

2018年に学びたい技術、読んでみたい本、完成させるGitHubリポジトリなどをピックアップ。
随時追加・更新する予定。 ※最終更新日:2019/01/05

Technology

技術名 進捗 備考
ディープラーニング 中止
(ざっくり)デザインの理論 中止
(ざっくり)経営論 一部進行
Angular5 中止 6,7 が出たので学び直す