Skip to content

Instantly share code, notes, and snippets.

View OhkuboSGMS's full-sized avatar
🐈
LLM Cat

OkuboSGMS OhkuboSGMS

🐈
LLM Cat
View GitHub Profile
import itertools
from time import sleep
# pip install obsws-python
import obsws_python as obs
OBS_PASSWORD = '<OBS-Password>'
TARGET_SOURCE_NAME = '<ソースに表示されているなまえ>'
obscl = obs.ReqClient(host='localhost', port=4455, password=OBS_PASSWORD)
from pydrive2.drive import GoogleDrive
from pydrive2.auth import GoogleAuth
#https://docs.iterative.ai/PyDrive2/filemanagement/#upload-file-to-a-specific-folder
def login_with_service_account():
"""
Google Drive service with a service account.
note: for the service account to work, you need to share the folder or
files with the service account email.
@OhkuboSGMS
OhkuboSGMS / file_url.py
Created February 9, 2023 14:46
Jetbrainsのターミナルでリンクを作成する
from pathlib import Path
print(Path(__file__).as_uri())
@OhkuboSGMS
OhkuboSGMS / data_hash.py
Created November 19, 2022 11:14
eq=True and fronze=True has __hash__ function
from dataclasses import dataclass
@dataclass(frozen=True)
class Params:
user_name: str
age: int
weight: float
@OhkuboSGMS
OhkuboSGMS / grid.py
Created December 10, 2021 15:20
ground grid
import numpy as np
import open3d as o3d
def grid_line(size=2):
x = np.arange(-size, size + 1)
y = np.array((-size, size))
x_1 = np.repeat(x, 2)
y_1 = np.tile(y, size * 2 + 1)
z = np.zeros_like(x_1)
x_line = np.vstack((x_1, y_1, z)).T
@OhkuboSGMS
OhkuboSGMS / mp4-mp4-resize.ps1
Last active September 18, 2020 06:22
ffmpeg resize with cuvid (gpu encode) power shell
Param($searchPath)
if (!$searchPath) {
Write-Warning "Pass Search Directory Path"
exit
}
Get-ChildItem $searchPath
if (![bool] (Get-Command ffmpeg -ErrorAction SilentlyContinue)) {
@OhkuboSGMS
OhkuboSGMS / calendar_counter.dart
Last active December 20, 2019 15:40
月ごとのイテレーター
import 'dart:collection';
main(){
// var base =DateTime(2019,2);
// var cnt =0;
// for (var d in MonthRange(DateTime(base.year,base.month-6),base)) {
// print(d);
// cnt++;
// }
// print("Count :$cnt");
@OhkuboSGMS
OhkuboSGMS / wave.ts
Created November 22, 2019 08:34
Surfing on TTY
const stream = process.stdout;
let consoleWidth = undefined;
function delay(ms: number) {
return new Promise(resolve => setTimeout(() => resolve(), ms))
}
function sinBuffer(buf: Buffer, memory: boolean[][], row: number, column: number) {
const bytes = 3;
const Installer = function(root) {
let promptEvent;
const install = function(e) {
if(promptEvent) {
promptEvent.prompt();
promptEvent.userChoice
.then(function(choiceResult) {
// The user actioned the prompt (good or bad).
// good is handled in
@OhkuboSGMS
OhkuboSGMS / SlackNotificationOnBuildFinish.cs
Created April 15, 2019 11:21
SlackにBuild通知を投げる tokenにアプリのtokenを設定する
using System;
using System.Collections;
using System.Text;
using Unity.EditorCoroutines.Editor;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
using UnityEngine.Networking;
namespace BuildProcess