Skip to content

Instantly share code, notes, and snippets.

@onionmk2
onionmk2 / UsingJsonDotNetInUnity.cs
Last active August 17, 2022 20:08
Json.Net ( Newtonsoft.Json ) in Unity
using System;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
using UnityEngine;
public class UsingJsonDotNetInUnity : MonoBehaviour
{
private void Awake()
{
@onionmk2
onionmk2 / ue.css
Created December 6, 2021 20:22
unreal c++ doc css. Regex: https:\/\/docs\.unrealengine\.com\/.+\/en-US\/API.+
th {
padding: 0;
}
td {
padding: 0;
}
table {
margin: 0 0 1em 0;
@onionmk2
onionmk2 / shelf_script.py
Created December 26, 2018 02:25
Houdini, create 2 network box and note
# region for autocomplete
import hou
from hou import SopNode, Node
hou.attribType.Point = 1
hou.attribType.Prim = 2
hou.attribType.Vertex = 3
hou.attribType.Global = 4
from typing import List, Type, Any, Union, Callable, Tuple
@onionmk2
onionmk2 / export step from fusion.py
Created April 30, 2020 17:52
stepをfusion360からエクスポートするスクリプト。16行目を自分の環境に合わせて変える。
import adsk.core, adsk.fusion, traceback
import os.path, sys
def run(context):
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
# get active design
@onionmk2
onionmk2 / import step to fusion360.py
Last active April 30, 2020 17:49
stepをfusion360にインポートするスクリプト。13行目を自分の環境に合わせて変える。
# FusionAPI_python Import3DCadFiles ver0.0.1
# Author-onionmk2
import adsk.core, adsk.fusion, traceback
import os.path
def run(context):
ui = None
try:
app = adsk.core.Application.get()
@onionmk2
onionmk2 / twitter stylus.css
Created March 15, 2020 23:45
stylus for twitter
/* begin------------幅を広げる------------*/
/* デフォのcssがmax-width: 600px; のような値を入れてくるせいで無駄に狭い。デフォのcssを殺して最大化。 */
[data-testid="primaryColumn"] {
max-width: -webkit-fill-available;
}
/* URLが https://twitter.com/home なら子セレクタ(>)だけに限定できる。
しかし それ以外のURLでは、 子孫セレクタで一括指定する以外修正できないので、やむなく子孫セレクタを使用。*/
[data-testid="primaryColumn"] div {
max-width: -webkit-fill-available;
}
@onionmk2
onionmk2 / show_points_.py
Last active February 16, 2020 21:33
show "control points" or "solid point" in rhono
#from typing import Any, Iterable
import Rhino
import rhinoscriptsyntax as rs
import scriptcontext as sc
doc = Rhino.RhinoDoc.ActiveDoc # type: Rhino.RhinoDoc
objectTable = doc.Objects # type: Rhino.DocObjects.Tables.ObjectTable
selected_objects = objectTable.GetSelectedObjects(includeLights=False, includeGrips=False) # type: Iterable[Rhino.DocObjects.RhinoObject]
@onionmk2
onionmk2 / save youtube cap.js
Last active March 1, 2019 07:19
save youtube caption.js
const divs = document.querySelectorAll(".cue.style-scope.ytd-transcript-body-renderer");
const array = Array.from(divs);
const texts = array.map(t => t.textContent.trim()+"\n");
const fileName = document.title;
const file = new File(texts, fileName, {
type: "text/plain",
});
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; ! is Alt. Alt +2 が押されるまで待機ということ。
!2::
SysGet, monitor1, Monitor, 1
SysGet, monitor2, Monitor, 2
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; ! is Alt. Alt +1 が押されるまで待機ということ。
!1::
SysGet, monitor1, Monitor, 1
SysGet, monitor2, Monitor, 2