This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import os | |
def get_aspect_ratio(image_path): | |
with Image.open(image_path) as img: | |
width, height = img.size | |
aspect_ratio = round(width / height, 1) | |
return aspect_ratio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import os | |
def get_aspect_ratio(image_path): | |
with Image.open(image_path) as img: | |
width, height = img.size | |
aspect_ratio = round(width / height, 1) | |
return aspect_ratio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Whenever a tag push matching pattern "v*" then run the job | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
# job id, can be anything | |
export_game: | |
# Always use ubuntu-latest for this action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LSB_RELEASE := $(shell lsb_release -cs) | |
WHOAMI := $(shell whoami) | |
SYSTEM := $(shell uname -s) | |
ARCH := $(shell uname -m) | |
NODE_VERSION := 14 | |
PHOENIX_VERSION := 1.5.8 | |
install-nodejs: | |
cd /tmp/ | |
curl -sL https://deb.nodesource.com/setup_$(NODE_VERSION).x -o nodesource_setup.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in $( ls ); do | |
echo $(( ( RANDOM % 10 ) + 1 )) > force_phpstorm_synchronize.php | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(window.FormData){ | |
var formData = new FormData($('form#uppic', $('div#upload'))[0]); | |
$.ajax({ | |
url:'/upload/'+gUUID, | |
type:'POST', | |
xhr:function(){ | |
var myXhr = $.ajaxSettings.xhr(); | |
if(myXhr.upload){//check if upload property exists | |
myXhr.upload.addEventListener('progress', sendpic.progressHandle); | |
} |