This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"log" | |
"net/http" | |
"os" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require("axios"); | |
const fs = require("fs"); | |
const createCsvWriter = require("csv-writer").createObjectCsvWriter; | |
// GitHubの認証トークンを設定してください | |
const githubToken = "GITHUB_TOKEN"; | |
const owner = "OWNER"; // リポジトリの所有者 | |
const repo = "REPOSITORY_NAME"; // リポジトリ名 | |
const startDate = "2024-06-01T00:00:00Z"; | |
const endDate = "2024-06-30T23:59:59Z"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get repository information | |
query GetRep { | |
repository(name: "riot", owner: "riot") { | |
id | |
name | |
url | |
} | |
} | |
# get user information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const readline = require('readline') | |
const reader = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout | |
}) | |
reader.on('line', line => { | |
if (line !== "fin") { | |
console.log(line) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()}` |
NewerOlder