Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am cj-bc on github.
* I am cj_bc (https://keybase.io/cj_bc) on keybase.
* I have a public key ASB02ROhs7LVXkvpeWEsLbT3VwMWygYFXsk2rYWleWAQxAo
To claim this, I am signing this object:
@Cj-bc
Cj-bc / example.hs
Last active January 6, 2021 15:56
Some snippets for reanimate
animation, animation' :: Animation
animation = scene $ do
play $ mkAnimation 1 $ const $ withFillOpacity 0 $ center $ mkRoundedBox (screenWidth/2) (screenHeight/2) 0.1
animation' = scene $ do
s <- fork $ newSpriteA drawBox'
spriteE s $ overBeginning 0.5 fadeInE
spriteE s $ overEnding 0.5 fadeOutE
fork $ play $ mapA (withStrokeColor "red") $ drawCircle'
make main
pandoc -f markdown -t ipynb -o homework.ipynb homework.md
PYTHONASYNCIODEBUG=1 jupyter-nbconvert --to notebook --execute --debug homework.ipynb
[NbConvertApp] Searching ['/Users/me/Documents/notes/univ/2020/q4/Programming/day3', '/Users/me/.jupyter', '/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/etc/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
[NbConvertApp] Looking for jupyter_config in /etc/jupyter
[NbConvertApp] Looking for jupyter_config in /usr/local/etc/jupyter
[NbConvertApp] Looking for jupyter_config in /usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/etc/jupyter
[NbConvertApp] Looking for jupyter_config in /Users/me/.jupyter
[NbConvertApp] Looking for jupyter_config in /Users/me/Documents/notes/univ/2020/q4/Programming/day3
[NbConvertApp] Looking for jupyter_nbconvert_config in /etc/jupyter
@Cj-bc
Cj-bc / pyenv-win.json
Last active November 21, 2020 00:20
scoop app manifests
{ "version": "v2.64.3"
, "architecture": {
"64bit": {
"url": "https://github.com/pyenv-win/pyenv-win/archive/master.zip"
}
, "32bit": {
"url": "https://github.com/pyenv-win/pyenv-win/archive/32bit-train.zip"
}
}
, "env_set": {
@Cj-bc
Cj-bc / rename.sh
Last active May 19, 2020 04:46
画像の横幅で連番リネームするスクリプト
# Require bash, imagemagick, awk
# THIS IS NOT TESTED; USE ON YOUR OWN RESPONSIVILITY
# テストされていません(動作確認していません)。自己責任で使ってください。
# 使い方: こいつに実行権限与えて `./rename.sh <ファイル1> <ファイル2> ...`
# もしくは $@の部分をファイル名に置き換えればいい
# 画像ファイルが保存されているディレクトリで実行してください。違うディレクトリのファイルを指定した場合、実行後、カレントディレクトリにファイルが移動します。
identify -format "%w %f\n" $@ | sort | awk 'BEGIN {i=0} {suffix="."sub(".*\\.", "", $2); print "mv", $2, i++suffix}' | xargs -L1 eval
#!/usr/bin/env bash
#
# ponytail -- A translator to whitespace
#
# Just a whitespace variant for ponytail language
# This is fan-made April fool script for Souma mirei, ponytail VTuber
#
# Copyright 2020 (c) Cj-bc a.k.a Cj.BC_SD
# This software is released under MIT License
<X_X>:gi-gtk-declarative$ stack clean
(GHQ) $?is0[master]<ttys010>
<X_X>:gi-gtk-declarative$ stack build
gi-gtk > configure
gi-gtk > [1 of 2] Compiling Main ( /private/var/folders/f4/_n6jxvsd1wd5cck49ntypshc0000gn/T/stack-da57df67cd52391f/gi-gtk-3.0.27/Setup.hs, /private/var/folders/f4/_n6jxvsd1wd5cck49ntypshc0000gn/T/stack-da57df67cd52391f/gi-gtk-3.0.27/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/setup/Main.o )
gi-gtk > [2 of 2] Compiling StackSetupShim ( /Users/me/.ghq/github.com/Cj-bc/dotfiles/dotfiles/stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /private/var/folders/f4/_n6jxvsd1wd5cck49ntypshc0000gn/T/stack-da57df67cd52391f/gi-gtk-3.0.27/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/setup/StackSetupShim.o )
gi-gtk > Linking /private/var/folders/f4/_n6jxvsd1wd5cck49ntypshc0000gn/T/stack-da57df67cd52391f/gi-gtk-3.0.27/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/setup/setup ...
gi-gtk > Parse e
[ 3676.305] (WW) Failed to open protocol names file lib/xorg/protocol.txt
[ 3676.306]
X.Org X Server 1.20.5
X Protocol Version 11, Revision 0
[ 3676.309] Build Operating System: Linux Arch Linux
[ 3676.310] Current Operating System: Linux thecatarch 5.3.11-arch1-1 #1 SMP PREEMPT Tue, 12 Nov 2019 22:19:48 +0000 x86_64
[ 3676.310] Kernel command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=PARTUUID=9af83216-7344-4883-88d8-4761913c02c3 rw
[ 3676.311] Build Date: 25 October 2019 08:43:50AM
[ 3676.316]
[ 3676.317] Current version of pixman: 0.38.4
@Cj-bc
Cj-bc / 問題を再現する必要最低限のコード.cs
Last active November 19, 2019 01:25
Unityで、カメラの可動域をMathf.Clampで制限しようと思った時におこった挙動の理由と解決方法 https://twitter.com/Cj_bc_sd/status/1196352398253387777?s=20
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClampTest : MonoBehaviour
{
public float _x;
public float axis;
// Update is called once per frame
void Update()
Initialize engine version: 2018.3.5f1 (76b3e37670a4)
GfxDevice: creating device client; threaded=1
2019-09-09 21:11:05.925 testBuild-Plain-20190909-2018.3.5f1[81586:17192702] RDT233WLM preferred device: Intel(R) UHD Graphics 630 (low power)
2019-09-09 21:11:05.925 testBuild-Plain-20190909-2018.3.5f1[81586:17192702] Metal devices available: 1
2019-09-09 21:11:05.926 testBuild-Plain-20190909-2018.3.5f1[81586:17192702] 0: Intel(R) UHD Graphics 630 (low power)
2019-09-09 21:11:05.926 testBuild-Plain-20190909-2018.3.5f1[81586:17192702] Using device Intel(R) UHD Graphics 630 (low power)
Initializing Metal device caps: Intel(R) UHD Graphics 630
Begin MonoManager ReloadAssembly
- Completed reload, in 0.113 seconds
Metal RecreateSurface[0x10e78bb90]: surface size 1920x1080