Skip to content

Instantly share code, notes, and snippets.

@devlights
devlights / test.py
Last active August 10, 2022 03:00
Pythonでマルチバイト文字を扱う際に気をつける点。
# vim:fileencoding=utf-8
import codecs
import sys
import types
if __name__ == '__main__':
#
# ターミナルに出力する場合
# 以下のサンプルは、ターミナルに出力する場合は
# うまくいくが、リダイレクトさせてファイルに出力すると
@staltz
staltz / introrx.md
Last active July 25, 2024 13:33
The introduction to Reactive Programming you've been missing
@hanula
hanula / two_letter_domains.txt
Created February 23, 2015 16:31
2 letter domains
aa.je
ae.je
ae.gg
ae.ht
af.je
af.cx
af.gg
af.gl
af.ht
ah.je
@keijiro
keijiro / 00_AnimationProcessor.md
Last active September 25, 2022 03:47
[Unity] アニメーションのインポート設定を自動化する

アニメーションのインポート設定を自動化する

Unity のアニメーションのインポート設定(下画像)には様々な項目がありますが、これを手動でひとつひとつ設定していくのは、かなりしんどいです。お決まりの設定がある場合には、スクリプトで自動化してしまうのがよいでしょう。この文書では、その自動化の方法を紹介します。

Animation Clip Settings

スクリプトからオプションを変更する

これらのインポート設定は ModelImporter.clipAnimationsModelImporterClipAnimation の配列として格納されています。これを舐める形で変更していけば、一括でお好みの設定を適用できます。

@pylover
pylover / a2dp.py
Last active May 27, 2024 21:51
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@uupaa
uupaa / build-ffmpeg-and-frei0r.md
Last active December 25, 2018 19:41
ffmpeg 3.2.4, frei0r 1.4.0 をソースコードからビルドする

ffmpeg 3.2.4, frei0r 1.4.0 をソースコードからビルドする

ffmpeg, frei0r をソースコードからビルドするための環境を用意します

  • ~/.profile を用意し source ~/.profile で適用します

    CFLAGS=`freetype-config --cflags`
    LDFLAGS=`freetype-config --libs`
    

PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig

@yukimunet
yukimunet / validation.php
Last active October 21, 2018 03:58 — forked from oppara/validation.php
Laravel 5.5 日本語バリデーションメッセージファイル
<?php
return [
/*
|--------------------------------------------------------------------------
| Validation Language Lines
|--------------------------------------------------------------------------
|
| The following language lines contain the default error messages used by
@jakechen
jakechen / opencv-python_rekognition.py
Created September 20, 2017 15:38
Using opencv to parse frames for Amazon Rekognition to analyze. This example uses Rekognition's celebrity recognition feature as an example.
# With help from https://aws.amazon.com/blogs/ai/build-your-own-face-recognition-service-using-amazon-rekognition/
frame_skip = 100 # analyze every 100 frames to cut down on Rekognition API calls
import boto3
import cv2
from PIL import Image
import io
rekog = boto3.client('rekognition')
@alexanderameye
alexanderameye / TemplatePass.cs
Last active July 10, 2024 20:58
URP 12 ScriptableRenderPass Template
// ScriptableRenderPass template created for URP 12 and Unity 2021.2
// Made by Alexander Ameye
// https://alexanderameye.github.io/
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class TemplatePass : ScriptableRenderPass
# Script for converting a HF Diffusers saved pipeline to a Stable Diffusion checkpoint.
# *Only* converts the UNet, VAE, and Text Encoder.
# Does not convert optimizer state or any other thing.
# Written by jachiam
import argparse
import os.path as osp
import torch