Skip to content

Instantly share code, notes, and snippets.

@WakkyFree
WakkyFree / コード.gs
Last active January 29, 2022 02:29
push LINE bot
const channel_token = "UIpPzOrXdyx4zUP1bhFd9sQg7CIsrphl7+XNHwKwOlbCWJaAkguxgxAingEdR0S69M71Nl8SptXWaSwxOe+xcRxV0Z6Qa73nQntjzVd4bFadID+1VPFiVEAZy7dh1xqzZ5qJLIkA8BNWKyOcMhfEowdB04t89/1O/w1cDnyilFU="
const user_id = "U2ef379160645782a81e85ad5a583eda1"
const url_push = "https://api.line.me/v2/bot/message/push";
const url_reply = "https://api.line.me/v2/bot/message/reply"
function pushMessage() {
let postData = {
"to": user_id,
"messages": [{
"type": "text",
@WakkyFree
WakkyFree / コード.gs
Last active January 29, 2022 02:22
reply2
let channel_token = "Your access token"
let url = "https://api.line.me/v2/bot/message/reply"
function doPost(e) {
let json = e.postData.contents
let events = JSON.parse(json).events;
events.forEach(function(event) {
if(event.type == "follow") {
follow(event);
@WakkyFree
WakkyFree / コード.gs
Last active January 29, 2022 02:19
reply LINE bot
let channel_token = "Your access token"
let url = "https://api.line.me/v2/bot/message/reply"
function doPost(e) {
let json = e.postData.contents
let events = JSON.parse(json).events;
events.forEach(function(event) {
if(event.type == "follow") {
follow(event);
@WakkyFree
WakkyFree / 32bit_assembler.py
Created January 26, 2022 13:04
32bir assembler for the assembly language defined in https://www.coronasha.co.jp/np/isbn/9784339029062/
# This is the assembler for the assembly language defined in https://www.coronasha.co.jp/np/isbn/9784339029062/
import sys
def p_b(digits, num):
num_int = int(num)
if(num_int > 0):
print(format(num_int, 'b').zfill(digits), end = "", file=fw)
else:
print(format(num_int & 0xffff, 'b').zfill(digits), end = "", file=fw)
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script type="text/javascript">
function update() {
google.script.run
.withSuccessHandler(result).getScriptUrl();
function result(url){
window.open(url, '_top')
@WakkyFree
WakkyFree / spreadsheet_read_test.gs
Created July 21, 2021 15:48
google apps script to read spreadsheet
function readSheet(){
var data = openSheet().getDataRange().getValues();
return data;
}
function doGet() {
const htmlOutput = HtmlService.createTemplateFromFile('ss_open_test').evaluate();
htmlOutput.setTitle("スプレッドシート読み込みテスト");
return htmlOutput;
}
@WakkyFree
WakkyFree / spreadsheet_write_test.gs
Last active July 21, 2021 15:46
google apps script to write spreadsheet
function writeSheet(e) {
var ss = openSheet();
ss.appendRow([e]);
}
function doGet() {
const htmlOutput = HtmlService.createTemplateFromFile('ss_open_test').evaluate();
htmlOutput.setTitle("スプレッドシート書き込みテスト");
return htmlOutput;
}
@WakkyFree
WakkyFree / spreadsheet_read_test.html
Created July 21, 2021 15:42
html to read spreadsheet
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<h1>スプレッドシート読み込みテスト</h1>
<p>スプレッドシートから読み込んだ内容を表示↓</p>
<?
var data = readSheet();
@WakkyFree
WakkyFree / spreadsheet_write_test.html
Created July 21, 2021 14:29
html to write spreadsheets by google apps script
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<script type="text/javascript">
function sendText(){
google.script.run
.withSuccessHandler(inform())
.writeSheet(document.forms['formText'].elements['message'].value);
}
@WakkyFree
WakkyFree / BearWalk.cs
Created April 17, 2021 04:51
control bear walk and stop
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BearWalk : MonoBehaviour
{
private Animator bearAnm;
// Start is called before the first frame update
void Start()
{