Skip to content

Instantly share code, notes, and snippets.

View rayriffy's full-sized avatar
⌨️
Ground pounding keyboard

Phumrapee Limpianchop rayriffy

⌨️
Ground pounding keyboard
View GitHub Profile
@rayriffy
rayriffy / Install NVIDIA Driver and CUDA.md
Created March 1, 2018 13:11 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
@rayriffy
rayriffy / start.sh
Created March 9, 2018 18:14
Automatic restart minecraft when server goes down
#!/bin/sh
while true
do
echo "##########STARTING###########"
java -Xms100M -Xmx8G -jar spigot.jar
echo ""
echo ""
echo "Restarting in:"
for i in 5 4 3 2 1
do
@rayriffy
rayriffy / _security.conf
Created May 7, 2018 11:53
Security headers for NGINX server blocks
# STRICT ORIGIN WHEN CROSS ORIGIN
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;

Keybase proof

I hereby claim:

  • I am rayriffy on github.
  • I am rayriffy (https://keybase.io/rayriffy) on keybase.
  • I have a public key whose fingerprint is E9DB 85FE 488F 1776 A86E AEDD A00E DA35 934E AD9A

To claim this, I am signing this object:

_人人人人人人人人人人人人_
> 害悪プレイヤーの流儀 <
> 毒★麻痺★眠り     <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
@rayriffy
rayriffy / autoplay.js
Last active May 11, 2020 13:01
Autoplay script for SEGA minigame: https://chunithm.sega.jp/minigame_memory/
Array.from({ length: document.querySelectorAll('div.card-backPicture').length / 2 })
.map((_, i) => [...document.querySelectorAll(`div.card-backPicture`)].filter(el => el.style.backgroundImage === `url("./images/master/score-${String(i + 1).padStart(2, '0')}.jpg")`))
.reduce((promise, pair) => {
return promise.then(() => {
return new Promise(resolve => {
setTimeout(() => {
resolve(pair.map(el => el.click()))
}, 3000);
})
})
let getAllNameInMeeting = () => Array.from(document.querySelector('calling-roster-section[data-tid=participantsInCall]').querySelectorAll('div.name > span')).map(o => o.textContent.toLowerCase())
let leaveIfSomeoneLeave = (name) => {
try {
const lowerCaseNames = getAllNameInMeeting()
// if not found, then leave
if (!lowerCaseNames.includes(name)) {
console.log(`[leaveIfSomeoneLeave] "${name}" is leaving! stopping the call`)
document.querySelector('#hangup-button').click()
@rayriffy
rayriffy / popcat.js
Last active August 15, 2021 15:39
popcat.click clicker
// popcat auto-clicker
// by rayriffy
// drop this into DevTools console
// to run:
// let agent = clicker()
//
// to stop:
// agent.stop()

Keybase proof

I hereby claim:

  • I am rayriffy on github.
  • I am rayriffy (https://keybase.io/rayriffy) on keybase.
  • I have a public key ASAbxF7JiJYGvMGmXpoZHmN-JG89r49B_m-KTTFJfl41BAo

To claim this, I am signing this object: