Skip to content

Instantly share code, notes, and snippets.

View zaoldreck's full-sized avatar

Peerapong Jaroentammakit zaoldreck

View GitHub Profile
(async () => {
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
console.log("🚀 เริ่มต้นระบบ Unfollow แบบมีดีเลย์...");
while (true) {
// หา UserCell ทั้งหมดบนหน้าจอ
const userCells = document.querySelectorAll('[data-testid="UserCell"]');
let processedInThisTurn = 0;
@zaoldreck
zaoldreck / twitter.js
Last active April 11, 2024 06:58
twitter follow back
// Function to click all buttons with the text 'Follow'
function clickFollowButtons() {
// Get all button elements on the page
var buttons = document.querySelectorAll('div div div span span');
// Initialize a delay variable
var delay = 0;
// Iterate through each button
buttons.forEach(function(button) {
// Function to click all buttons with the text 'Follow'
function clickFollowButtons() {
// Get all button elements on the page
var buttons = document.querySelectorAll('button');
// Initialize a delay variable
var delay = 0;
// Iterate through each button
buttons.forEach(function(button) {
require 'gtk3'
require 'rmagick'
class ImageBrowser
def initialize(interval)
@folder = get_folder_from_user
@interval = interval
@images = load_images
@current_image_index = 0
end
function fileseq {
a=1
for i in *; do
if file -b --mime-type "$i" | grep -q '^image/'; then
date=$(date +%Y%m%d)
new="${date}-${a}.${i##*.}"
mv -i -- "$i" "$new"
let a=a+1
fi
done
class LottoService
URL = 'https://lotto.api.rayriffy.com'
def initialize(list = [])
@list = [
"608422",
"806874",
"622593",
"851085",
"227936",
require 'active_record/connection_adapters/postgresql/schema_statements'
module ActiveRecord
module ConnectionAdapters
module PostgreSQL
module SchemaStatements
# Resets the sequence of a table's primary key to the maximum value.
def reset_pk_sequence!(table, pk = nil, sequence = nil) #:nodoc:
unless pk and sequence
default_pk, default_sequence = pk_and_sequence_for(table)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
$ vi ~/.xrayconfig
```
---
:editor: /usr/local/bin/code
```
Open irbrc file:
$ vi ~/.irbrc
Paste lines:
require "awesome_print"
AwesomePrint.irb!