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 / gist:b165146c73511c76a8899d4857d49eb4
Last active August 27, 2021 12:47
docker-compose logs
Last login: Fri Aug 27 19:34:44 on ttys001
cd % kanel@MacBooker ~ % cd Documents/go24/pos.graphql-engine
kanel@MacBooker pos.graphql-engine % docker-compose logs
Attaching to posgraphql-engine_graphql-engine_1, posgraphql-engine_postgres_1
graphql-engine_1 | {"timestamp":"2021-08-27T12:45:38.000+0000","level":"info","type":"startup","detail":{"kind":"migrations-startup","info":"migrations server port env var is not set, defaulting to 9691"}}
graphql-engine_1 | {"timestamp":"2021-08-27T12:45:38.000+0000","level":"info","type":"startup","detail":{"kind":"migrations-startup","info":"server timeout is not set, defaulting to 30 seconds"}}
graphql-engine_1 | {"timestamp":"2021-08-27T12:45:38.000+0000","level":"info","type":"startup","detail":{"kind":"migrations-startup","info":"starting graphql engine temporarily on port 9691"}}
graphql-engine_1 | {"timestamp":"2021-08-27T12:45:38.000+0000","level":"info","type":"startup","detail":{"kin
@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"
@skanel
skanel / Exercise-1
Last active December 28, 2017 06:26
Exercise-C++
`
/**********************HELLO WORLD***************************
* Author: Nel
* History
* 2014/03/27 first create Traicode
*************************************************************/
#include "stdio.h"
#include "conio.h"