Skip to content

Instantly share code, notes, and snippets.

View sentenzo's full-sized avatar

Roman Timushev sentenzo

View GitHub Profile
"""
A couple of tools to build a database URL (dialect[+driver]://user:password@host:port/dbname).
Examples of such URLs:
postgresql://scott:tiger@localhost/test
mysql+pymysql://scott:tiger@localhost/foo
oracle://scott:tiger@127.0.0.1:1521/sidname
Application examples:
env_mapping = {
@sentenzo
sentenzo / demo.html
Last active May 7, 2018 14:24
Knowledge tiles constructor
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>imposition</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<script src="js/marked.min.js"></script>
<script src="js/knoTiler.js"></script>
@sentenzo
sentenzo / bacVer.c
Last active July 6, 2016 13:55
SQL Server backup version definer
#include <stdio.h> // sprintf(), fopen(), fscanf(), printf()
#include <stdlib.h> // malloc()
unsigned char bArr0[] = {0x20, 0x00, 0x53, 0x00, 0x51, 0x00, 0x4c, 0x00};
int takeByteArr(char* fName, int bStart, int bLength, unsigned char* out) {
FILE* f = fopen(fName, "rb");
if(fseek(f, bStart, SEEK_SET) != 0) {
fclose(f);
return -1;
@sentenzo
sentenzo / big_fib.cpp
Created November 16, 2015 11:15
Strange and pointless algorithmic training
#include <iostream>
using namespace std;
int main() {
unsigned long long int fNum = 0;
unsigned int div = 0;
cin >> fNum >> div;
//fNum = 11527523930876953;
//div = 26673;
@sentenzo
sentenzo / base.java
Last active November 16, 2015 10:53
Rational number conversion to non decimal base
package com.company;
import java.util.Scanner;
import java.util.HashMap;
public class Main {
// / n \
// | --- |
// \ d /(b)
@sentenzo
sentenzo / med.py
Last active November 15, 2015 16:42
#!/usr/bin/env python3
import random
#################################################
# globals
#
#################################################
arr0 = []