Skip to content

Instantly share code, notes, and snippets.

@AJpon
AJpon / toggleGoogleDriveVirtualFolderLocalize.ps1
Created May 18, 2024 13:54
Windows版 GoogleDriveFS (GoogleDriveDesktop) にある、マウントポイントを自動的にLocalizeする機能のオンオフを切り替えるPowerShellスクリプト
param(
[Parameter()]
[ValidateSet("machine", "user")]
[string]$scope = "user",
[switch]$help
)
if ($help) {
Write-Output "`nThis script accepts the following arguments:"
Write-Output "--scope: Specify 'machine' or 'user'. The default is 'user'."
@AJpon
AJpon / Microsoft.PowerShell_profile.ps1
Last active June 10, 2024 00:54
My PowerShell Profiles
# Microsoft.PowerShell_profile.ps1
# ##############################################################################
# This profile is for the current user
# This profile loads when the current user opens the PowerShell console
#
# To create a profile for all users, create a profile in the $PSHOME directory
# To create a profile for the current user, create a profile in the $PROFILE directory
# To find the $PROFILE directory, run $PROFILE in the PowerShell console
# To find the $PSHOME directory, run $PSHOME in the PowerShell console
#
@AJpon
AJpon / main.yml
Last active November 3, 2023 08:06
UPMパッケージをnpmに登録するGitHub Actions
name: UPM on npsjs.com
on:
workflow_dispatch:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
@AJpon
AJpon / ai2svg.pde
Created July 20, 2021 07:39
Cinema 4D の Sketch and Toon で書き出した illustrator 形式のファイルを SVG に変換
import processing.svg.*;
String[] lines;
void setup() {
// スケッチのサイズはC4Dのレンダリング解像度と同じにしてください
size(1280, 720);
noFill();
noLoop();
strokeWeight(0.1);
@AJpon
AJpon / hls_downloader.bat
Created February 12, 2021 03:53
FFmpegを用いてHLS(HTTP Live Streaming)形式の動画をダウンロードするバッチファイル
@echo off
setlocal enabledelayedexpansion
set selfname=%~n0
cd /d %~dp0
@REM 引数による条件処理
if "%1"=="" (
call :usage
goto :success
)
@AJpon
AJpon / simpleTextOutput.pde
Created August 21, 2020 09:53
昔のADVゲームやRPGゲームでよく見かけたテキスト表示を行う最低限のプログラム
String str = "abcdefg";
int textSize = 60;
int intervalTime = 120; // 文字の表示間隔をミリ秒で指定
void setup() {
size(300, 100);
textSize(textSize);
fill(248);
}
@AJpon
AJpon / QuantizeEffector.py
Last active August 27, 2019 12:17
Paste to PythonEffector
import c4d
from c4d.modules import mograph as mo
from c4d import utils
# Functions
def quantize(num, step):
return step*(num//step)
def vectorQuantize(vec, stepParams):
vecX = quantize(round(vec.x, 10), stepParams.x)
@AJpon
AJpon / PN_AddQuantizeEffector.py
Last active August 27, 2019 12:31
This script create QuantizeEffector on C4D
import c4d
from math import pi
from c4d.modules import mograph as mo
# Functions
def dataAddVector(obj, name, parent, unit, step, Min, default):
ud = c4d.GetCustomDatatypeDefault(c4d.DTYPE_VECTOR)
ud[c4d.DESC_NAME] = name
ud[c4d.DESC_UNIT] = unit
ud[c4d.DESC_STEP] = step