Skip to content

Instantly share code, notes, and snippets.

View muthugit's full-sized avatar
🕓
code at 4am

Muthupandian muthugit

🕓
code at 4am
View GitHub Profile
version: '3'
x-airflow-common:
&airflow-common
image: apache/airflow:2.3.0
environment:
- AIRFLOW__CORE__EXECUTOR=LocalExecutor
- AIRFLOW__CORE__SQL_ALCHEMY_CONN=postgresql+psycopg2://postgres:postgres@postgres:5432/airflow
- AIRFLOW__CORE__FERNET_KEY=FB0o_zt4e3Ziq3LdUUO7F2Z95cvFFx16hU8jTeR1ASM=
- AIRFLOW__CORE__LOAD_EXAMPLES=False
- AIRFLOW__CORE__LOGGING_LEVEL=INFO
@muthugit
muthugit / clickhouse_db_to_db_copy.sh
Created September 2, 2021 06:08
Clickhouse Copy data from one database engine to another engine
clickhouse-client --host <sourceIP> --password <password> --database <source_db> \
--query="select * from <source table> FORMAT Native" | \
clickhouse-client --user default --password <local db password> --database <local database> \
--query="insert into <local table name> FORMAT Native"
#!/usr/local/bin/python
# coding: utf-8
__author__ = 'muthugit'
import re
class Conditional_Formatter:
"""Find the invalid if statements and replace with the correct one
:param file_path: A valid file path of the python file
#!/usr/local/bin/python
# coding: utf-8
__author__ = 'muthugit'
# Importing system libraries
import sys
import ast
import re
variables = []
__author__ = "MUTHUPANDIAN"
__email__ = "contact@muthupandian.in"
'''
PERFORM SOME OPERATIONS IN THE EXISTING DATAFRAME USING APPLY METHOD
''''
import pandas as pd
#FUNCTIONS TO PERFORM OPERATION BETWEEN TWO COLUMNS
@muthugit
muthugit / replaceEmptyCells.py
Last active January 25, 2019 11:48
replace empty cells in dataframe using lambda
__author__ = "MUTHUPANDIAN"
__email__ = "contact@muthupandian.in"
'''
TO REMOVE THE NONE DATATYPE FROM THE EMPTY CELLS
''''
# IMPORTING LIBRARIES
import pandas as pd
// set the dimensions of the canvas
function bar(element, jsonData, xColumnName, yColumnName) {
elementTop = $(element).position().top
elementLeft = $(element).position().left
elementHeight = $(element).height()
elementWidth = $(element).width()
// alert(elementLeft)
var margin = { top: 50, right: 20, bottom: 70, left: 50 },
width = elementWidth - 100,
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="https://bootswatch.com/3/paper/bootstrap.css" media="screen">
<link rel='stylesheet' href='style.css' type='text/css' media='all' />
</head>
import pandas as pd
from flask import request
from flask import Flask
from flask_cors import CORS, cross_origin
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
df = pd.read_csv("data.csv")
@muthugit
muthugit / input.js
Created March 22, 2018 20:23
How to stop special characters from input box runtime?
$('#inputBoxId').keypress(function(e) {
if (!/[a-zA-Z-]/.test(String.fromCharCode(e.which)))
return false;
})