Skip to content

Instantly share code, notes, and snippets.

View so298's full-sized avatar

Sosuke Hosokawa so298

View GitHub Profile
@so298
so298 / code-tunnel.md
Last active November 13, 2023 15:49
VSCode CLIを利用したVSCode Tunnelのセットアップ

VSCode CLIを利用したVSCode Tunnelのセットアップ

概要

VSCode CLIをサーバーにインストールすることで、SSHを経由することなくVSCodeやvscode.dev上からサーバーにアクセスすることができる様になる

できること&できないこと (2023/11/13時点)

できること

@so298
so298 / deno_proxy.ts
Last active October 28, 2023 06:14
deno proxy
// main.ts
import { serve } from "https://deno.land/std/http/server.ts";
const target = "https://example.com"; // destination URL
const port = 8000;
async function handleRequest(req: Request): Promise<Response> {
const url = new URL(req.url);
const targetUrl = `${target}${url.pathname}${url.search}`;
@so298
so298 / cudaMemcpyBandwidthTest.cu
Last active September 17, 2023 11:16
cudaMemcpy bandwidth test
#include <iostream>
#include <ctime>
#include <cuda_runtime.h>
#define MEGA_BYTE (1'000'000)
const int N = 100 * MEGA_BYTE; // Size of data
const int numIterations = 100; // iteration
// CUDA error check macro
@so298
so298 / main.gs
Created August 29, 2023 18:18
カウントダウンbot by Google App Script
function sendNotification() {
const webhookUrl = PropertiesService.getScriptProperties().getProperty('WEBHOOK_URL');
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
const sheet = spreadsheet.getSheetByName("日程表");
const lastRow = sheet.getLastRow();
const values = sheet.getRange(`A2:B${lastRow}`)
.getValues();
function convertToMessage(values) {