Skip to content

Instantly share code, notes, and snippets.

View Thanajade's full-sized avatar

Thanajade Dechananthachai Thanajade

View GitHub Profile
@Thanajade
Thanajade / index.html
Created September 14, 2023 13:16 — forked from kristw/index.html
Thailand map
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300|Josefin+Slab|Arvo|Lato|Vollkorn|Abril+Fatface|Old+Standard+TT|Droid+Sans|Lobster|Inconsolata|Montserrat|Playfair+Display|Karla|Alegreya|Libre+Baskerville|Merriweather|Lora|Archivo+Narrow|Neuton|Signika|Questrial|Fjalla+One|Bitter|Varela+Round);
.background {
fill: #eee;
pointer-events: all;
}
@Thanajade
Thanajade / install-multiple-jdk-on-macos-high-sierra.md
Created September 27, 2022 10:25 — forked from ntamvl/install-multiple-jdk-on-macos-high-sierra.md
Install Multiple Java Versions on macOS High Sierra

Install Multiple Java Versions on macOS High Sierra

Install Homebrew Cask

On Mac, Homebrew is the de-facto package manager, and Homebrew Cask is the app manager. I’m going to use Cask to install Java 7 and 8.

Install Homebrew Cask first if you haven’t:

brew update
brew tap caskroom/cask
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@Thanajade
Thanajade / run_application.sh
Created July 5, 2022 06:27 — forked from nik-sta/run_application.sh
Production-ready Entrypoint Bash Script for layered Spring Boot Applications
#!/bin/sh
JAVA_OPTS="-Dfile.encoding=UTF-8 -Duser.timezone=UTC"
PORT="8080"
cd /srv/"$APP" || exit
/opt/java/bin/java $JAVA_OPTS org.springframework.boot.loader.JarLauncher --bind 0.0.0.0:$PORT
@Thanajade
Thanajade / build_application.sh
Created July 5, 2022 06:27 — forked from nik-sta/build_application.sh
Production-ready Application Build Bash Script for layered Spring Boot Applications
#!/bin/sh
JAR_FILE=application.jar
if [ ! -f "$JAR_FILE" ]; then
echo "build.error: application jar is missing!"
exit 1
fi
jar xf application.jar
REQUIRED_JAVA_MODULES="$(jdeps \
@Thanajade
Thanajade / Dockerfile
Last active July 5, 2022 06:26 — forked from nik-sta/Dockerfile
Layered Production-ready Dockerfile for Spring Boot Applications
# Making here use of a docker multi-stage build
# https://docs.docker.com/develop/develop-images/multistage-build/
# Build-time container
FROM eclipse-temurin:17.0.3_7-jdk-alpine as builder
ARG JAR_FILE
WORKDIR application
COPY $JAR_FILE application.jar
COPY build_application.sh ./
RUN sh build_application.sh
@Thanajade
Thanajade / mysql-docker.sh
Created April 13, 2022 14:40 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
<?php
/*
http://stackoverflow.com/questions/12448134/social-share-links-with-custom-icons
http://petragregorova.com/articles/social-share-buttons-with-custom-icons
wp_enqueue_style('fontAwesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css', array(), '4.3.0', 'all');
use in template files:: <?php echo do_shortcode('[social_sharing]') ; ?>
*/
@Thanajade
Thanajade / inject.py
Created February 2, 2017 15:30 — forked from leonjza/inject.py
Wordpress 4.7.0/4.7.1 Unauthenticated Content Injection PoC
# 2017 - @leonjza
#
# Wordpress 4.7.0/4.7.1 Unauthenticated Content Injection PoC
# Full bug description: https://blog.sucuri.net/2017/02/content-injection-vulnerability-wordpress-rest-api.html
# Usage example:
#
# List available posts:
#
# $ python inject.py http://localhost:8070/