Skip to content

Instantly share code, notes, and snippets.

View chaidhat's full-sized avatar
🇹🇭
Thai

Chaidhat Chaimongkol chaidhat

🇹🇭
Thai
View GitHub Profile
.monaco-workbench,
.monaco-workbench .sidebar,
.monaco-workbench .part.panel.right,
.monaco-workbench .part.panel .pane-body.integrated-terminal .terminal-outer-container,
.composite.title,
.pane-header.expanded,
.activity-bar-placeholder,
.monaco-workbench .activitybar,
.monaco-workbench .monaco-list-rows,
.monaco-editor .margin,
@chaidhat
chaidhat / adapative-terminal.sh
Created July 7, 2021 08:25
Mac OS Terminal which changes theme based on dark mode
DARKMODE=$(defaults read -g AppleInterfaceStyle)
# actually an || or && function could've worked as Light mode throws an error. but i wanted to show off
if [ "$DARKMODE" = "Dark" ]; then
osascript -e '
tell application "Terminal"
set current settings of selected tab of window 1 to settings set "Basic Dark"
end tell
' `pwd`
else
<html>
<script>
window.close();
</script>
</html>
@chaidhat
chaidhat / huh.js
Created January 16, 2021 07:23
huh
location.href = https://www.youtube.com/watch?v=dQw4w9WgXcQ;
@chaidhat
chaidhat / ai-linear-classification.py
Created January 14, 2021 02:54
Linear classification ML/AI - 100% my code by Chaidhat Chaimongkol
import math # this library helps with mathematics
import matplotlib.pyplot as plt # this library helps visual plotting
import random # this library generates random numbers
#
# Linear Classification AI by Chaidhat Chaimongkol. 100% my code.
#
# our data points in a 2D matrix
data = []
@chaidhat
chaidhat / machine-learning-linear-regression.py
Created January 11, 2021 14:14
My first ever machine learning with 100% code by me. No ML helper libraries used.
import math # this library helps with mathematics
import matplotlib.pyplot as plt # this library helps visual plotting
# our data points in a 2D matrix
data = [
[0.5, 1.4],
[2.3, 1.9],
[2.9, 3.2],
]
@chaidhat
chaidhat / kick-start-boilerplate.cpp
Last active October 19, 2020 08:09
Kickstart boilerplate code
// Chaidhat Chaimongkol
#include <bits/stdc++.h>
using namespace std;
void Solve ()
{
// str.length() is string's length
// str.at(i) where int i is the character at that index
//string str; cin >> str;
@chaidhat
chaidhat / Kick Start round G
Last active October 19, 2020 08:12
Kick Start round G 18/10/2020
18-OCT-2020
Chaidhat Chaimongkol
Partial Attempt - Place didn't count (Joined at 1.5 hours remaining)
6329/8100
@chaidhat
chaidhat / simultaneous-approximator.py
Last active October 4, 2020 13:26
Approximates simultaneous equations by brute force. Works with multiple solutions.
# Chaidhat Chaimongkol
# 02-10-20 for 5 hours
# I have developed a brute-forcer for simultaneous equations with two variables and can work with equations with more than one solution. Below is an example of how to use it.
import parser
import math
import copy
from math import sin
@chaidhat
chaidhat / Kick Start round E
Last active October 18, 2020 15:16
Kick Start round E 23/08/2020
23-AUG-2020
Chaidhat Chaimongkol
Partial Attempt - Place didn't count (Joined at 1 hour remaining)
9101/11400