Skip to content

Instantly share code, notes, and snippets.

View skanel's full-sized avatar

kso skanel

  • Phnom Penh, Cambodia
View GitHub Profile
@skanel
skanel / M2M_Association_SQLalchemy.py
Created February 27, 2022 10:17 — forked from SuryaSankar/M2M_Association_SQLalchemy.py
An example of a many to many relation via Association Object in SQLAlchemy
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import sessionmaker, relationship, backref
from sqlalchemy.ext.associationproxy import association_proxy
import uuid
engine = sqlalchemy.create_engine('sqlite:///:memory:')
Base = declarative_base()
@skanel
skanel / convert.sh
Created November 22, 2020 10:57 — forked from natrim/convert.sh
Simple conversion script that converts Godot html5 export to gzipped version, with decompressing wasm and pck files using pako
#!/bin/bash
### usage ./convert.sh game
## where game is baseName of the export
if [ ! "$1" ]; then
read -p 'Game name: ' game
else
game="$1"
fi
@skanel
skanel / QuadraticPy
Created May 2, 2019 11:26
Python quadratic equation solver
#!/usr/bin/env python
import math
#quadraticpy
# quadratic formula: (-b + or - sqrt(b^2 - 4ac)) / 2a
# define constant
# output is limited to 2 decimal places, can be changed below
dp = "%.2f"
@skanel
skanel / rename_phoenix_project.sh
Created January 23, 2018 10:42 — forked from kumekay/rename_phoenix_project.sh
rename a phoenix 1.3 project
#!/bin/bash
set -e
CURRENT_NAME="CurrentName"
CURRENT_OTP="current_name"
NEW_NAME="NewName"
NEW_OTP="new_name"