Skip to content

Instantly share code, notes, and snippets.

View ramazanpolat's full-sized avatar

Ramazan Polat ramazanpolat

View GitHub Profile
@ramazanpolat
ramazanpolat / countries.sql
Created March 16, 2023 23:53
SQL Table DDL and Date for countries, country codes and, phone codes for ClickHouse
CREATE TABLE countries
(
`id` UInt8,
`iso` String,
`name` String,
`nice_name` String,
`iso3` String,
`num_code` UInt32,
`phone_code` UInt32
)
CREATE TABLE states_raw(
d date,
uid UInt64,
first_name String,
last_name String,
modification_timestamp_mcs DateTime64(3) default now64(3)
) ENGINE = Null;
CREATE TABLE final_states_by_month(
d date,
@ramazanpolat
ramazanpolat / .bashrc
Last active July 30, 2020 19:57
Colored bash prompt. When exitcode OK it is happy :) Otherwise it is sad :(
export PS1='\[\e[33m\]\u@\h:\w\[\e[0m\] $(if [[ $? == 0 ]]; then echo "\[$(tput setaf 2)\]:) "; else echo "\[\e[31m\]:( "; fi)\[$(tput sgr0)\]'
@ramazanpolat
ramazanpolat / serdes.java
Created June 30, 2019 18:50
Java Bean to JSON
package com.rambo;
import com.arangodb.ArangoDBException;
import com.arangodb.entity.BaseDocument;
import com.arangodb.entity.CollectionEntity;
import com.arangodb.velocypack.VPack;
import com.arangodb.velocypack.VPackSlice;
import org.msgpack.MessagePack;
import com.arangodb.ArangoDB;
@ramazanpolat
ramazanpolat / bg_extract.py
Created June 30, 2019 01:55
background extraction with opencv
import cv2
import copy
class Copyable:
__slots__ = 'a', '__dict__'
def __init__(self, a, b):
self.a, self.b = a, b
@ramazanpolat
ramazanpolat / postgres-01
Last active June 10, 2019 14:37
Command for first time PostgreSQL 11 users
### installation
### connection
su - postgres
psql
#### psql commands
# connect to a database
\connect dbname
@ramazanpolat
ramazanpolat / build_install_python3.6.7.sh
Last active October 27, 2018 22:43
Build and install python 3.6.7 from source on Ubuntu 16.04 LTS(Xenial). Includes SSL/TLS for pip.
apt install build-essential -y
apt install zlib1g-dev -y
apt install libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev libtk8.5 libgdm-dev libdb4o-cil-dev libpcap-dev -y
apt update
apt upgrade
git clone https://github.com/deadsnakes/python3.6
cd python3.6
./configure --enable-optimizations
# make command will take 10 mins
make
import os
from typing import Any
from apistar import App, Route, http
from apistar.codecs.multipart import MultiPartCodec
from werkzeug.datastructures import FileStorage
UPLOAD_FOLDER = os.path.join('.', 'uploads')
PORT = 8080
@ramazanpolat
ramazanpolat / coin_info.py
Created December 9, 2017 21:48
Altcoin information
__coin_info = {
'1ST': {'name': 'FirstBlood', 'status': 'black', 'category': []},
'420G': {'name': 'GanjaCoin', 'status': 'black', 'category': ['drug']},
'4CHN': {'name': 'ChanCoin', 'status': 'black', 'category': ['gambling']},
'2GIVE': {'name': '2GIVE', 'status': 'black', 'category': ['riba']},
'ABY': {'name': 'ArtByte', 'status': 'white', 'category': []},
'ADA': {'name': 'Cardano', 'status': 'white', 'category': []},
'ADT': {'name': 'adToken', 'status': 'white', 'category': []},
'ADX': {'name': 'AdEx', 'status': 'white', 'category': []},
'AEON': {'name': 'Aeon', 'status': 'white', 'category': []},
@ramazanpolat
ramazanpolat / webpack.config.js
Created October 8, 2017 03:38 — forked from learncodeacademy/webpack.config.js
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"