Skip to content

Instantly share code, notes, and snippets.

@q8f13
q8f13 / 240112_diagram.py
Created January 12, 2024 11:38
pyplot diagram generate
import matplotlib.pyplot as plt
import matplotlib.dates
import numpy as np
from random import random
from random import gauss
from random import uniform
from datetime import datetime
@q8f13
q8f13 / gist:6ffd8ce00c111b800b61c6c8ceffef9b
Created January 4, 2024 06:36
Unity Util - find references via ripgrep
// from https://www.xuanyusong.com/archives/5073
public class SearchWindows : EditorWindow
{
[MenuItem ("Assets/Search Reference")]
public static void OpenWindow ()
{
(EditorWindow.GetWindow(typeof(SearchWindows)) as SearchWindows).Search = Selection.activeObject;
}
@q8f13
q8f13 / show_depends.bat
Created April 23, 2023 18:13
A batch script for showing all ESO addons dependencies. Put this script into {My Document Folder}\Elder Scrolls Online\live\AddOns\
REM Find and list all dependencies for addons
@echo off
for /R %%f in (*.txt) do findstr "DependsOn" "%%f"
pause
@q8f13
q8f13 / restart_udp_tunnel.xml
Created April 14, 2023 15:16
Restart some bat script using Windows Task Scheduler, udp2raw tunnel in this case
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2023-04-11T21:25:53.1150117</Date>
<Author>NAUTILUS\Dustfall</Author>
<URI>\Custom\restart_udp_tunnel</URI>
</RegistrationInfo>
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
@q8f13
q8f13 / main.rs
Last active April 11, 2023 10:20
Code chunk for generating dummy data through websocket communication. Rust / nodejs version
use std::io::{BufWriter, Write};
use std::thread;
use std::time::Duration;
use websocket::Message;
use websocket::sync::Server;
use rand::Rng;
fn main() {
// create wss
let server= Server::bind("127.0.0.1:9090").unwrap();
@q8f13
q8f13 / EditorCloseWindowTab.cs
Last active November 17, 2022 05:33
add close current tab to unity editor. Use with shortcut manager. Use with editor shortcut setup. For example "ctrl+w to close current active panel"
using UnityEngine;
using UnityEditor;
public class EditorCloseWindowTab : Editor
{
[MenuItem("Shortcuts/Close Window Tab")]
static void CloseTab()
{
EditorWindow focusedWindow = EditorWindow.focusedWindow;
if (focusedWindow != null)
@q8f13
q8f13 / GenerateMesh.gd
Created September 25, 2020 08:16
generate mesh via code in gdscript example
extends MeshInstance
"""
Example:
godot arrayMesh generate a box geometry
"""
var rings = 50
var radial_segments = 50
var radius = 1
export(float) var width_fwd = 1
@q8f13
q8f13 / .vimrc
Last active July 20, 2023 06:48
nvim config
"author Dustfall<dustfall@gmail.com>
"last change:2023/07/28
"
" Toggle Menu and Toolbar
set guioptions-=m
set guioptions-=T
map <silent> <F2> :if &guioptions =~# 'T' <Bar>
\set guioptions-=T <Bar>
\set guioptions-=m <bar>
\else <Bar>
@q8f13
q8f13 / userChrome.css
Created July 29, 2020 04:26
firefox user custom css - hide tab bar for using treetab
#TabsToolbar {
visibility: collapse !important;
height: 1px;
}
/* #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header { */
/* display: none; */
/* } */
@q8f13
q8f13 / extract_screenshots_using_subtitle_text_from_video_file
Created July 7, 2020 05:51
通过导出的“时间-字幕”文本文件,将对应的视频文件导出视频帧截图
#!/bin/bash
t=`awk '{ print $1 }' Assets/subtitles.txt`
n=1
for v in $t;
do
# echo $v
`ffmpeg -ss $v -i Recordings/movie0702.mp4 -vframes 1 -q:v 2 $n.jpg`
n=`expr $n + 1`
done