Skip to content

Instantly share code, notes, and snippets.

@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 / 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]
#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
@onionmk2
onionmk2 / edge.py
Last active December 27, 2018 15:52
# VEXで下記のコードが事前に必要です。
# i[]@neighbours = neighbours(0, @ptnum);
# i@point_number = @ptnum;
# [ [0, 1], [0, 3] ...] というように、edgeとなるpointの組を返します。
# get_point_pair_for_edge("point_number", "neighbours")
def get_point_pair_for_edge(ptnum_attr_name, neighbours_attr_name):
# type: (str, str) -> List[List[int]]
import hou
from itertools import chain
@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
W
PY
intrinsic:pointcount
intrinsic:bounds
intrinsic:measuredarea
intrinsic:memoryusage
@elemnum
@ptnum
@primnum