Skip to content

Instantly share code, notes, and snippets.

View tmwatchanan's full-sized avatar
⌨️
I use Neovim btw

Watchanan Chantapakul tmwatchanan

⌨️
I use Neovim btw
View GitHub Profile
{
"$schema": "vscode://schemas/color-theme",
"type": "dark",
"colors": {
"activityBar.background": "#141414",
"activityBar.foreground": "#cccccc99",
"activityBarBadge.background": "#88c0d0",
"activityBarBadge.foreground": "#000000",
"badge.background": "#88c0d0",
"badge.foreground": "#141414",
@tmwatchanan
tmwatchanan / simulated_annealing.py
Created February 7, 2024 07:46
Simulated annealing algorithm
import math
import random
from functools import partial
from typing import Callable, Sequence
class System:
def __init__(self) -> None:
pass
@tmwatchanan
tmwatchanan / settings.json
Created March 10, 2022 17:58
CodeRunner settings
{
"code-runner.runInTerminal": true,
"code-runner.executorMap": {
"python": "python3",
"cpp": "cd $dir && g++ -std=c++17 $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
},
}
@tmwatchanan
tmwatchanan / display-foreign-key-name.php
Created June 21, 2021 00:31
I have modified the original AdminerDisplayForeignKeyName to handle the case that if a foreign key is a string and the same field names. I took the original code from https://gist.github.com/anonymous/13b657087cf55323150c#file-display-foreign-key-name-php.
<?php
/**
* Adminer plugin that display the first CHAR/VARCHAR column of the foreign key
*
* @category Plugin
* @link http://www.adminer.org/plugins/#use
* @author Bruno VIBERT <http://www.netapsys.fr>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, antialiased=True, facecolors=facecolors, shade=True, linewidth=.5, edgecolor="black")
surf.set_edgecolor('k')
beaitufy_3d(ax)
################################################################################
def beautify_3d(ax):
ax.grid(False)
z_ticks = [t for t in ax.get_zticks() if t >= 0]
ax.set_zticks(z_ticks)
#include <windows.h>
#include <iostream>
#include <unistd.h>
using namespace std;
int main()
{
POINT point;
POINT* pts = new POINT[2];
@tmwatchanan
tmwatchanan / settings.json
Created December 23, 2020 18:16
Windows Terminal Settings
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"profiles": {
"defaults": {
data Prop;
length Group $12 Response $3;
input Group Response N;
datalines;
East More 10
East Less 90
West More 66
West Less 34
;
libname mydata 'C:\Users\PhotonUser\My Files\Temporary Files';
proc import datafile="C:\Users\PhotonUser\My Files\Temporary Files\pcp_mean-2010_2014-all_counties.csv"
out=mydata.pcp dbms=CSV;
run;
proc import datafile="C:\Users\PhotonUser\My Files\Temporary Files\farmers.csv"
out=mydata.farmers dbms=CSV;
run;
cp libicuin*.dll libicuuc*.dll libicudt*.dll libpcre2-16-0.dll libharfbuzz-0.dll \
libpng16-16.dll libfreetype-6.dll libgraphite2.dll libglib-2.0-0.dll libpcre-1.dll \
libbz2-1.dll libssl-1_1-x64.dll libcrypto-1_1-x64.dll libgcc_s_seh-1.dll libstdc++-6.dll \
libwinpthread-1.dll zlib1.dll libpq.dll libxml2-2.dll liblzma-5.dll libiconv-2.dll \
libintl-8.dll libdouble-conversion.dll libzstd.dll $INSTALLATION_ROOT