Skip to content

Instantly share code, notes, and snippets.

View zeemyself's full-sized avatar

Swas Kunakorn zeemyself

  • In your heart <3
View GitHub Profile
@zeemyself
zeemyself / temp.sh
Last active June 12, 2017 07:37
Script for get Pi temperature
#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"
@zeemyself
zeemyself / build.gradle
Created October 27, 2017 05:15
Script for react-native android
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 25
buildToolsVersion '27.0.0'
}
}
}
}
@zeemyself
zeemyself / .bash_profile
Created August 14, 2018 03:15
Mac terminal color
## Terminal color ##
export PS1="\[\033[36m\]\u\[\033[m\]:\[\033[33;1m\]\W\[\033[m\] \$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
diff --git a/node_modules/react-native/scripts/react_native_pods.rb b/node_modules/react-native/scripts/react_native_pods.rb
index db9a34a..e95b882 100644
--- a/node_modules/react-native/scripts/react_native_pods.rb
+++ b/node_modules/react-native/scripts/react_native_pods.rb
@@ -165,7 +165,7 @@ def use_react_native_codegen!(spec, options={})
return if ENV['DISABLE_CODEGEN'] == '1'
# The path to react-native (e.g. react_native_path)
- prefix = options[:path] ||= File.join(__dir__, "..")
+ prefix = options[:path] ||= "../../node_modules/react-native"
@zeemyself
zeemyself / panda.py
Created August 13, 2024 16:44
PandaTouch image in Python
from PIL import Image
import struct
def process_image(input_file, output_file, max_size=(250, 250)):
# Open the image using PIL
with Image.open(input_file) as img:
# Scale the image down to fit within max_size while maintaining aspect ratio
img.thumbnail(max_size)
# Ensure the image is in RGBA mode
@zeemyself
zeemyself / image_mover.sh
Created September 11, 2024 14:19
Move all images outside subdirectory
#!/bin/bash
# Iterate over each subfolder in the main directory
find . -type d -mindepth 1 -maxdepth 1 | while read -r subfolder; do
# Remove the leading './' from the subfolder path
subfolder_name=$(basename "$subfolder")
echo "Processing subfolder: $subfolder_name full path: $subfolder"
# Iterate over each image file in the subfolder
find "$subfolder" -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) | while read -r image; do
@zeemyself
zeemyself / jbppatch.sh
Created October 28, 2024 09:04 — forked from emaballarin/jbppatch.sh
[MacOS] Easily make incompatible JetBrains plugins "magically" compatible again!
#!/bin/bash -li
PNAME="$1"
PVER="$2"
JARNAME="${3-$PNAME}"
mkdir -p ./EXT01/
cd ./EXT01/ || exit
unzip ../"${PNAME}"-"${PVER}".zip
rm -f ../"${PNAME}"-"${PVER}".zip
mv ./"${PNAME}"/lib/"${JARNAME}"-"${PVER}".jar ./"${JARNAME}"-"${PVER}".zip