Skip to content

Instantly share code, notes, and snippets.

View sintret's full-sized avatar

andy fitria sintret

View GitHub Profile
const puppeteer = require('puppeteer');
var pages = {}
var browser;
var page = async() => {
try {
if (!browser) {
browser = await puppeteer.launch({
args: [
'--no-sandbox',
@sintret
sintret / mysql
Last active January 5, 2022 18:17
SHOW VARIABLES;
SELECT @@GLOBAL.sql_mode;
CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'total' cannot be null
Create mysqlId in the following way:
sql_mode= ""
SET sql_mode = '';
run mysql in background
@sintret
sintret / DO
Last active August 5, 2022 07:30
wildcard SSL using Digital Ocean API
$ sudo apt install python3-certbot-dns-digitalocean
$ certbot plugins
$ nano ~/certbot-creds.ini
# DigitalOcean API credentials used by Certbot
dns_digitalocean_token = dop_v1_4b621067b53b50.... Your API TOken
$ chmod 600 ~/certbot-creds.ini
@sintret
sintret / sudoers
Created August 16, 2022 10:28
sudoers user linux
adduser andy
usermod -aG sudo andy
@sintret
sintret / gist:37690ddcb835cfd05ba30397c359590d
Created February 16, 2024 18:03
Find and delete duplicate data in mysql postgresql
==mysql
SELECT employee_id, date FROM attendance group by date,employee_id having count(*) >= 2
DELETE t1 FROM attendance t1
INNER JOIN attendance t2
WHERE
t1.id < t2.id AND
t1.employee_id = t2.employee_id AND
t1.date = t2.date
;
@sintret
sintret / flutter
Last active October 28, 2024 09:58
flutter gradle
you can add this to the end of your app/build.gradle:
task printSdkVersions {
doLast {
println "The current compileSdkVersion is: ${android.compileSdkVersion}"
println "The current targetSdkVersion is: ${android.defaultConfig.targetSdkVersion}"
println "The current minSdkVersion is: ${android.defaultConfig.minSdkVersion}"
}
}
gradlew printSdkVersions