Skip to content

Instantly share code, notes, and snippets.

@totegamma
totegamma / apply_subbones.py
Last active Sep 26, 2022
つかいかた: アーマチュアを選択した状態で、nキーを押すと出てくるメニューのtoolにあるApply Subbonesボタンを押すだけ (https://twitter.com/totegamma/status/1574051804765376512/photo/1)
View apply_subbones.py
import bpy
import re
import sys
bl_info = {
"name" : "Apply Subbones",
"author" : "totegamma",
"version" : (0, 1, 0),
"blender" : (3, 3, 0),
"description" : "Apply Subbone weights and cleanup them.",
View .hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
View spotifyPlaylistSync.js
function myFunction() {
const sheet = SpreadsheetApp.getActive().getActiveSheet();
const client_id = sheet.getRange("B1").getValue();
const client_secret = sheet.getRange("D1").getValue();
const f1 = sheet.getRange("F1").getValue();
const playlist_id = f1.startsWith("https://open.spotify.com/") ? f1.slice(34, f1.indexOf('?')) : f1;
const keytuple = client_id + ":" + client_secret;
const client64 = Utilities.base64Encode(keytuple, Utilities.Charset.UTF_8);
View .vimrc
"-=-=-=-=-=-=-=-=-=-=--"
" .vimrc "
" created by thotgamma "
" https://gammalab.net "
"-=-=-=-=-=-=-=-=-=-=-="
" プラグイン管理ツールとしてdein.vimを使う。
" ### 定数等の設定
@totegamma
totegamma / lambda_function.py
Created Feb 16, 2021
Amplifyのビルド通知をDiscordに送るLambda(Python)
View lambda_function.py
from __future__ import print_function
import urllib.request
import json
print('Loading function')
# == :: 設定項目 :: ===========================================
endpoint = "https://discord.com/api/webhooks/YOURENDPOINT-URL"
accountName = 'YOUR ACCOUNT NAME'
accountImage = 'YOUR ACCOUNT IMAGE URL'
@totegamma
totegamma / test.json
Created Feb 15, 2021
AWS Cloud-Watch Alarm Event via SNS
View test.json
{
"Records":[
{
"EventSource":"aws:sns",
"EventVersion":"1.0",
"EventSubscriptionArn":"arn:aws:sns:ap-northeast-1:<省略>",
"Sns":{
"Type":"Notification",
"MessageId":"<省略 なんかID>",
"TopicArn":"arn:aws:sns:ap-northeast-1:<省略>",
@totegamma
totegamma / hls_stream.h
Created Aug 17, 2020
vivadoHLSのstreamを検証用に簡易的に実装したものです
View hls_stream.h
#include <stdio.h>
#include <queue>
namespace hls {
template <typename T>
class stream {
const char* name;
std::queue<T> queue;
View geojson.php
<?php
$todofuken=array(
'北海道'=>'hokkaido',
'青森県'=>'aomori',
'岩手県'=>'iwate',
'宮城県'=>'miyagi',
'秋田県'=>'akita',
'山形県'=>'yamagata',
'福島県'=>'fukushima',
View gist:d678d806925d66d11f9f409c15b4e72b
mat_coo_t* create_coo_from_mmfile(const char* filename) {
MTR_BEGIN_FUNC();
const int BufferSize = 1024;
FILE* fp = fopen(filename, "r");
char line[BufferSize];
int state = 0; //0: size, else: content
mat_coo_t* coo;
int itr = 0;
View vimrc.vim
"-=-=-=-=-=-=-=-=-=-=--"
" .vimrc "
" created by thotgamma "
" https://gammalab.net "
"-=-=-=-=-=-=-=-=-=-=-="
" プラグイン管理ツールとしてdein.vimを使う。
" ### 定数等の設定