Skip to content

Instantly share code, notes, and snippets.

View aK0nshin's full-sized avatar
:octocat:
Working from home

Alexander aK0nshin

:octocat:
Working from home
View GitHub Profile
@CSTDev
CSTDev / auto-increment-version.sh
Last active July 4, 2024 12:16
Script that will find the last Git Tag and increment it. It will only increment when the latest commit does not already have a tag. By default it increments the patch number, you can tell it to change the major or minor versions by adding #major or #minor to the commit message.
#!/bin/bash
#get highest tag number
VERSION=`git describe --abbrev=0 --tags`
#replace . with space so can split into an array
VERSION_BITS=(${VERSION//./ })
#get number parts and increase last one by 1
VNUM1=${VERSION_BITS[0]}
@huklee
huklee / MyLogger.py
Last active January 6, 2024 18:06
python Logger using example with Singleton Pattern
# -*- coding: utf-8 -*-
import logging
import os
import datetime
import time
class SingletonType(type):
_instances = {}
@azami
azami / sample.py
Last active October 11, 2020 12:18
SQLAlchemy Core Sample with relationship and polymorphic
# -*- coding: utf-8 -*-
from sqlalchemy import create_engine, func
from sqlalchemy import Table, Column, Integer, String, DateTime, MetaData, ForeignKey
from sqlalchemy.pool import NullPool
from sqlalchemy.orm import mapper, sessionmaker, relationship
params = {'user': 'admin',
'password': 'password',
'host': 'localhost',
@ciarans
ciarans / app.php
Last active March 8, 2022 12:16
Add Graylog to Laravel
$app->configureMonologUsing(function($monolog) {
$transport = new \Gelf\Transport\UdpTransport("127.0.0.1", 12201, \Gelf\Transport\UdpTransport::CHUNK_SIZE_LAN);
$publisher = new \Gelf\Publisher();
$publisher->addTransport($transport);
$monolog->pushHandler(new \Monolog\Handler\GelfHandler($publisher));
});