Skip to content

Instantly share code, notes, and snippets.

View xemoe's full-sized avatar
🏠
Working from home

Teerapong Ladlee xemoe

🏠
Working from home
  • Bangkok, Thailand
View GitHub Profile
@xemoe
xemoe / claude_3.5_sonnet_artifacts.xml
Created June 24, 2024 19:21 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
@xemoe
xemoe / ubuntu_2004_awus036ach.md
Created December 11, 2020 07:09
Ubuntu 20.04 setup wireless usb alfa awus036ach
@xemoe
xemoe / checklist.md
Created November 22, 2020 18:22
My Dream Job Checklist

My Dream Job Checklist

คะแนนเต็ม 100 คะแนน


วัฒนธรรมองค์กร (สูงสุด 39 คะแนน)

  • บริษัท/หัวหน้างาน ไม่ควรลงมากำหนดเกี่ยวกับวิธีการทำงาน เมื่อมีการคุยและตกลงวิธีการทำงานไปแล้ว (No micromanagement). (9 คะแนน)
  • ไม่มีกฏที่เข้มงวด เช่นการต้องอธิบายเหตุผลเมื่อลุกออกจากโต๊ะทำงาน หรือมาสายในบางครั้ง หรือทำไมต้องดู Youtube. ตราบใดที่ยังสามารถส่งงานได้ตรงตามเวลาและไม่มีใครเกิดปัญหาติดขัดจากงานที่ทำ. (8 คะแนน)
  • ความสมดุลของเวลาในการทำงาน
    • 7 คะแนน for 40 hour weeks.
    • 3 คะแนน for 40 hour weeks with overtime (ในบางครั้ง) to up-to 60 hours.
@xemoe
xemoe / fail2ban.md
Created April 5, 2020 12:55 — forked from joecampo/fail2ban.md
fail2ban – stop HTTP(S) route abuse/brute forcing

If you're not familiar: What is fail2ban? fail2ban is an awesome linux service/monitor that scans log files (e.g. auth.log for SSH) for potentially malicious behavior. Once fail2ban is tripped it will ban users for a specified duration by adding rules to Iptables. If you're unfamiliar with fail2ban Chris Fidao has a wonderful (& free!) series about security including setting up fail2ban here.

Recently Laravel released a new feature in 5.1 to throttle authentication attempts by simply adding a trait to your authentication controller. The Laravel throttle trait uses the inputted username, and IP address to throttle attempts. I love seeing this added to a framework out of the box, but what about some of our other apps not built on Laravel? Like a WordPress login? Or even an open API etc.? Ultimately,

package main
import (
"fmt"
"os"
"path/filepath"
"github.com/go-fsnotify/fsnotify"
)
@xemoe
xemoe / prob.js
Last active August 29, 2019 21:40
Learning Bayes
var sum = function(members) {
var sumvalue = 0;
for(var key in members) {
if (members.hasOwnProperty(key)) {
sumvalue += members[key]
}
}
return sumvalue
}
@xemoe
xemoe / Makefile
Created April 15, 2019 17:06 — forked from DerekV/Makefile
example Makefile to install required software
#gnu makefile
REQUIRED-SOFTWARE=emacs git sudo
EMACS-INIT-FILE?=~/.emacs
EMACS-LISP-BASE?=~/.emacs.d/lisp
DOTFILES-DIR?=~/dotfiles
## DOTFILES-REPO?= YOUR DOTFILES REPO HERE
@xemoe
xemoe / sum.go
Last active January 12, 2019 02:05
golang concurrent sum
package main
import (
"fmt"
"sync"
)
func main() {
process()
}
@xemoe
xemoe / example.md
Created November 13, 2018 12:14
Laravel validate with combination fields
//
// Laravel validate with combination fields
//
// Use
//

return function($attributes) {
 return [
@xemoe
xemoe / install.sh
Created October 8, 2018 08:09 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`