Skip to content

Instantly share code, notes, and snippets.

Avatar

Akio Ohta Drunkar

View GitHub Profile
@Drunkar
Drunkar / zip_all_folders.bat
Created July 12, 2022 07:41
このファイルが置かれたフォルダにある全てのフォルダを7zipを使ってzip化する
View zip_all_folders.bat
cd /D "%~dp0"
for /D %%G in ("*.*") do (
echo %%~nxG
"C:\Program Files\7-Zip\7z.exe" a "%%~nxG.zip" "%%~nxG"
)
cmd /k
@Drunkar
Drunkar / CMakeList.txt
Last active February 2, 2022 10:30
pybind11+MinGWのcmake+visual studio 2019でboostライブラリを使用したスクリプトのpythonモジュールを作成するCMakeList.
View CMakeList.txt
# CMakeのバージョン
cmake_minimum_required(VERSION 3.19)
# プロジェクト名
project(proj_name CXX)
# PyBind11 を取得
include(FetchContent)
FetchContent_Declare(
pybind11
@Drunkar
Drunkar / chrome_gpu_bug_case.html
Created December 24, 2021 07:52
If you remove `touch-action: none;` at line 13, translate3d is accelrated by GPU correctly
View chrome_gpu_bug_case.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<div style="height: 480px; width: 600px; display: block">
<div
style="
height: 100%;
@Drunkar
Drunkar / index.html
Last active November 23, 2021 06:53
Electron laggy translate3d testcase. This is based on blockly's Javascript generator demo: https://github.com/google/blockly/blob/master/demos/generator/index.html . I added large amount of blocks to that.
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Blockly Demo: Generating JavaScript</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/blockly/7.20211209.0-beta.0/blockly_compressed.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/blockly/7.20211209.0-beta.0/blocks_compressed.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/blockly/7.20211209.0-beta.0/javascript_compressed.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/blockly/7.20211209.0-beta.0/msg/en.min.js"></script>
<style>
View kindle_cloud_reader_gtranslate_bookmarklet.js
javascript: (function () {
/* Kindle Translator V 0.4*/
/* based on ACRExtensions via https://github.com/binarycrafts/ACRExtensions */
var w = null;
var kDoc = null;
var kObj = null;
if (typeof window.KindleReaderContextMenu !== 'undefined') {
w = window;
} else if (window.length) {
for (var i=0;i<window.length;i++) {
View kindle_cloud_reader_deepl_bookmarklet.js
javascript: (function () {
/* Kindle Translator V 0.4*/
/* based on ACRExtensions via https://github.com/binarycrafts/ACRExtensions */
var w = null;
var kDoc = null;
var kObj = null;
if (typeof window.KindleReaderContextMenu !== 'undefined') {
w = window;
} else if (window.length) {
for (var i=0;i<window.length;i++) {
View a_star.py
# coding: utf-8
import heapq
import itertools
class AStar(object):
def __init__(self, map, obstacle_symbol=1):
self.map = map
self.obstacle = obstacle_symbol
@Drunkar
Drunkar / cycle_detection_tarjan.py
Created July 17, 2018 08:51
Tarjan's cycle detection algorithm in Python.
View cycle_detection_tarjan.py
# coding: utf-8
import numpy as np
import argparse
import logging
logger = logging.getLogger(__name__)
def strong_connection(G, s, v, i, node_index, visited_stack):
"""Tarjan's strong connection detection algorithm.
Args:
@Drunkar
Drunkar / images_to_mp4.bat
Last active May 9, 2018 14:53
vvvv video write example
View images_to_mp4.bat
ffmpeg -y -r 30 -i "./render_%%06d.png" -start_number 10011 -vcodec libx264 -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -r 30 ./rendered.mp4
View CLI_template.py
# coding: utf-8
import logging
import traceback
import argparse
import time
from logging.handlers import RotatingFileHandler
from contextlib import contextmanager
logger = logging.getLogger(__name__)