Skip to content

Instantly share code, notes, and snippets.

@tuanh18051993
tuanh18051993 / t3mc.py
Created September 27, 2020 10:59 — forked from denkspuren/t3mc.py
Die Monte Carlo Tree Search für Tic-Tac-Toe (Code zu meinem Video https://youtu.be/CjldSexfOuU)
# Code aus meinem YouTube-Video https://youtu.be/CjldSexfOuU
import random, copy
class Board:
def __init__(self):
self.board = [0,0,0,0,0,0,0,0,0]
self.moves = []
self.turn = +1
@tuanh18051993
tuanh18051993 / stat-cache.js
Created November 2, 2017 03:31 — forked from anaisbetts/stat-cache.js
Make your Electron apps load faster, with this One Weird Trick
// Include this at the very top of both your main and window processes, so that
// it loads as soon as possible.
//
// Why does this work? The node.js module system calls fs.realpathSync a _lot_
// to load stuff, which in turn, has to call fs.lstatSync a _lot_. While you
// generally can't cache stat() results because they change behind your back
// (i.e. another program opens a file, then you stat it, the stats change),
// caching it for a very short period of time is :ok: :gem:. These effects are
// especially apparent on Windows, where stat() is far more expensive - stat()
// calls often take more time in the perf graph than actually evaluating the
@tuanh18051993
tuanh18051993 / OpenWithSublimeText3.bat
Created October 24, 2017 02:58 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f