Skip to content

Instantly share code, notes, and snippets.

onionmk2

Block or report user

Report or block onionmk2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View move cursor right by alt 2.ahk
#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
View move cursor left by alt 1.ahk
#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
View edge.py
# 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 Dec 26, 2018
Houdini, create 2 network box and note
View shelf_script.py
# 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
View vex symbols
W
PY
intrinsic:pointcount
intrinsic:bounds
intrinsic:measuredarea
intrinsic:memoryusage
@elemnum
@ptnum
@primnum
View a.js
// paste this into web console
codes = $("code");
contents = Array.from(codes).map(i => i.textContent); //.filter(i => i.includes("@"));
uniqs = contents.filter((v, i, a) => a.indexOf(v) === i);
copy(uniqs.join('\n')); // save array to clipboard
@onionmk2
onionmk2 / pixologic.css
Created Jul 31, 2018
stylus for pixologic
View pixologic.css
.entry-content > ul > li {
margin: 0 0 0 36px;
}
.entry-content > ul {
list-style-type: circle;
}
.entry-content > ol {
list-style-type: decimal;
}
h2 {
@onionmk2
onionmk2 / use_cudaMallocManaged.cu
Last active Jan 8, 2018
use_cudaMallocManaged.cu
View use_cudaMallocManaged.cu
#include <cuda_runtime.h>
#include <iostream>
#include <device_launch_parameters.h>
#include "cuda_error_detector.h"
#include <vector>
#ifdef __CUDACC__
#define KERNEL_ARGS2(numerOfBlocks, threadsPerBlock) <<< numerOfBlocks, threadsPerBlock >>>
#define KERNEL_ARGS3(numerOfBlocks, threadsPerBlock, sh_mem) <<< numerOfBlocks, threadsPerBlock, sh_mem >>>
View KERNEL_ARGS.cu
#ifdef __CUDACC__
#define KERNEL_ARGS2(numerOfBlocks, threadsPerBlock) <<< numerOfBlocks, threadsPerBlock >>>
#define KERNEL_ARGS3(numerOfBlocks, threadsPerBlock, sh_mem) <<< numerOfBlocks, threadsPerBlock, sh_mem >>>
#define KERNEL_ARGS4(numerOfBlocks, threadsPerBlock, sh_mem, stream) <<< numerOfBlocks, threadsPerBlock, sh_mem, stream >>>
#else
#define KERNEL_ARGS2(numerOfBlocks, threadsPerBlock)
#define KERNEL_ARGS3(numerOfBlocks, threadsPerBlock, sh_mem)
#define KERNEL_ARGS4(numerOfBlocks, threadsPerBlock, sh_mem, stream)
#endif
@onionmk2
onionmk2 / get_global_id.cu
Last active Jan 5, 2018 — forked from athiakos/cuda cheat sheet
cuda のid計算がよくわからないので、まとめてみる。
View get_global_id.cu
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
namespace comment_thread_id
{
/*
blockIdx.x == n
blockIdx.y == 1
blockIdx.z == 1
You can’t perform that action at this time.