Skip to content

Instantly share code, notes, and snippets.

View nekonenene's full-sized avatar

ハトネコエ nekonenene

View GitHub Profile
@nekonenene
nekonenene / code.gs
Last active March 3, 2024 06:01
QQEnglish のレッスン予約完了メールを元に、Googleカレンダーのスケジュールを作成
// 1時間おきのトリガーを設定すること
// appsscript.json の timeZone を Asia/Tokyo にしておかないと変な時間にスケジュールが作られてしまうので注意
// QQEnglish のレッスン予約完了メールを元に、Googleカレンダーのスケジュールを作成
function getQQReservedLessonMail() {
const targetHours = 1;
const targetHoursInMilliSeconds = 60 * 60 * 1000 * targetHours;
const subject = "【QQEnglish】レッスン予約完了";
const query = (`newer_than:${targetHours}h subject:"${subject}"`);
const threads = GmailApp.search(query);
@nekonenene
nekonenene / .gitconfig
Last active August 9, 2020 17:06
ブログ公開用データ: .gitconfig の一例
[url "git@github.com:"]
pushInsteadOf = https://github.com/ # use SSH
[user]
name = ハトネコエ
email = hatonekoe@gmail.com
[alias]
st = status
co = checkout
sw = switch
br = branch
@nekonenene
nekonenene / main.go
Last active May 8, 2020 14:33
文字種類PのN文字をT回発行した時に重複する確率を 0.1% 未満にしたかった
package main
import (
"fmt"
"math"
)
// かぶらない可能性
// charPattern: 文字種, n: 文字数, tryCount: 試行回数
func notDuplicate(charPattern uint64, n uint64, tryCount uint64) float64 {
@nekonenene
nekonenene / main.go
Last active April 25, 2020 13:32
動画概要欄の古いURLを新しいURLに直す go script (ブログ公開用)
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"strings"
@nekonenene
nekonenene / kizuna_bot_for_blog.rb
Last active July 23, 2019 22:28
Discord bot。 gem install discordrb が必要(ブログ公開用) https://nekonenene.hatenablog.com/entry/2018/07/19/061201
require "discordrb"
require "net/http"
require "uri"
require "json"
# dotenv を使用する場合はここのコメントを解除します(※ gem install dotenv が必要)
# require "dotenv"
# Dotenv.load
class KizunaBot
@nekonenene
nekonenene / circle.yml
Last active May 23, 2019 19:56
ビルドしたものだけを gh-pages に push する(ブログ公開用) https://nekonenene.hatenablog.com/entry/2016/11/02/040706
general:
branches:
ignore:
- gh-pages
machine:
timezone: Asia/Tokyo
node:
version: v6.1.0
@nekonenene
nekonenene / config.yml
Last active May 23, 2019 19:48
CircleCI 2.0 で gh-pages にビルドしたものだけを push (ブログ公開用) https://nekonenene.hatenablog.com/entry/2018/08/21/052420
# Ref: https://circleci.com/docs/2.0/deployment-integrations/
version: 2
jobs:
build: # runs not using Workflows must have a `build` job as entry point
working_directory: ~/repo
docker:
- image: circleci/node:8 # 8系がLTSなので使用
steps:
- checkout # special step to check out source code to working directory
- run:
@nekonenene
nekonenene / client01.go
Last active May 23, 2019 19:47
Client for my gRPC server(ブログ公開用) https://nekonenene.hatenablog.com/entry/grpc-nginx-proxy
package main
import (
"context"
"crypto/tls"
"log"
"os"
"strconv"
"time"
@nekonenene
nekonenene / client02.go
Last active May 23, 2019 19:47
Client for my gRPC server(ブログ公開用) https://nekonenene.hatenablog.com/entry/2019/02/17/073806
package main
import (
"context"
"go/build"
"log"
"os"
"strconv"
"time"
@nekonenene
nekonenene / config.yml
Last active May 23, 2019 19:44
Android アプリを deploygate にデプロイする CircleCI 2.0 設定(ブログ公開用) https://nekonenene.hatenablog.com/entry/circleci_2-deploygate-android
aliases:
android_docker: &android_docker
docker:
- image: circleci/android:api-28
environment:
TZ: Asia/Tokyo
steps:
- restore_cache: &restore_cache
key: &jars_key jars-{{ checksum "build.gradle.kts" }}-{{ checksum "app/build.gradle.kts" }}
- run: &download_deps