Skip to content

Instantly share code, notes, and snippets.

View 4geru's full-sized avatar
🐼
Please send message to me in Twitter DM, if you want to contact.

koichi uchinishi 4geru

🐼
Please send message to me in Twitter DM, if you want to contact.
View GitHub Profile
@4geru
4geru / gist:e28d93497d4caaa8606c055e72ce848d
Created March 22, 2024 23:54
gas save image and reply image
//LINEボットのアクセストークン
var LINE_BOT_ACCESS_TOKEN = PropertiesService.getScriptProperties().getProperty("LINE_BOT_ACCESS_TOKEN");
// PropertiesService.getScriptProperties
//Googleドライブに作ったフォルダのURLの末尾にある30文字くらいの文字列
var GOOGLE_FOLDER_ID = PropertiesService.getScriptProperties().getProperty("GOOGLE_FOLDER_ID");
//返信用エンドポイント
var REPLY_URL = 'https://api.line.me/v2/bot/message/reply';
const sendMessage = (replyToken, replyMessageObject) =>{
@4geru
4geru / reservations.json
Last active March 10, 2023 22:13
microCMS schema for LIFF microCMS hands on
{"apiFields":[{"idValue":"dGOAD3wATu","fieldId":"reservationAt","name":"予約日時","kind":"date"},{"fieldId":"userName","name":"ユーザー名","kind":"text"},{"fieldId":"lineId","name":"LINE ID","kind":"text","isUnique":false},{"fieldId":"staff","name":"担当者ID","kind":"relation","referenceDisplayItem":"qcMMjuRytc"},{"fieldId":"course","name":"コース","kind":"number"},{"fieldId":"clientFreeForm","name":"ユーザー自由記入欄","kind":"textArea"},{"fieldId":"staffFreeForm","name":"店舗自由記入欄","kind":"textArea"}],"customFields":[]}
@4geru
4geru / LINE Rev UP 2022 事前準備
Last active October 15, 2022 08:18
LINE Rev UP 2022 「LINE API 総集編。ReactとmicroCMSで作るLINEミニアプリハンズオン」 の事前準備です。
## イベント情報
[LINE API開発者向けカンファレンス「REV UP 2022」](https://linedevelopercommunity.connpass.com/event/260460/)
[LINE API 総集編。ReactとmicroCMSで作るLINEミニアプリハンズオン](https://revup.jp/session/zo58ff17id)
## 事前準備
- node.js インストールをおねがいします。
- [Download | Node.js](https://nodejs.org/en/download/)
{"apiFields":[{"idValue":"z-2OeHTwbJ","fieldId":"userId","name":"LINE ユーザーID","kind":"text","required":true,"isUnique":true},{"fieldId":"title","name":"タイトル","kind":"text","isUnique":false},{"fieldId":"content","name":"本文","kind":"textArea"}],"customFields":[]}
User.create(name: 'しげる')
Recipe.create(name: 'カレー', url: 'https://_cookpad_の_url')
RecipeMaterial.create(recipe_id: 1, material_id: 1)
Material.create(name: 'じゃがいも', amount: 5)
class Product
def use
raise NotImplementedError
end
end
class Factory
def create(owner)
p = create_product(owner)
register_product(p)
def image_upload_local(img)
if img
# contents = Contribution.last
# id = contents.id
logger.info img
ext = File.extname(img[:filename])
# img_name = "#{id}-bbs#{ext}"
img_name = "img#{ext}"
@4geru
4geru / azure_vision_face.rb
Created November 5, 2017 12:43
AzureVisionAPIから顔の部分を抽出しました。
require 'net/http'
require 'json'
# NOTE: You must use the same location in your REST call as you used to obtain your subscription keys.
# For example, if you obtained your subscription keys from westus, replace "westcentralus" in the
# URL below with "westus".
uri = URI('https://westcentralus.api.cognitive.microsoft.com/vision/v1.0/analyze')
uri.query = URI.encode_www_form({
# Request parameters
'visualFeatures' => 'Faces',
@4geru
4geru / 575チェッカー
Created October 22, 2017 11:30
575かどうかmecabで判定してくれます
import sys
import MeCab
def judge_five_seven_five(word):
m = MeCab.Tagger ("-Ochasen")
print(m.parse (word))
check = [5, 7, 5] # 5, 7, 5
check_index = 0
word_cnt = 0
node = m.parseToNode(word)
8 06, 2017 12:50:16 午前 org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry loadTestEngines
情報: Discovered TestEngines with IDs: [junit-jupiter]
Exception in thread "main" java.lang.NoSuchMethodError: org.junit.platform.commons.util.AnnotationUtils.findAnnotatedMethods(Ljava/lang/Class;Ljava/lang/Class;Lorg/junit/platform/commons/util/ReflectionUtils$MethodSortOrder;)Ljava/util/List;
at org.junit.jupiter.engine.descriptor.LifecycleMethodUtils.findBeforeAllMethods(LifecycleMethodUtils.java:41)
at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.<init>(ClassTestDescriptor.java:88)
at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.<init>(ClassTestDescriptor.java:77)
at org.junit.jupiter.engine.discovery.TestContainerResolver.resolveClass(TestContainerResolver.java:98)
at org.junit.jupiter.engine.discovery.TestContainerResolver.resolveElement(TestContainerResolver.java:47)
at org.junit.jupiter.engine.discovery.JavaElementsResolver.tryToResolveWithResolver(JavaElementsResolver.jav