Skip to content

Instantly share code, notes, and snippets.

View sairamch04's full-sized avatar

Sairam Cherupally sairamch04

View GitHub Profile
@sairamch04
sairamch04 / script.py
Created July 24, 2024 14:41
Jgrapht GraphMLExportor to Neo4j supported GraphML format
from lxml import etree
# Load the GraphML file
SRC_FILE = 'graph.graphml'
DEST_FILE = 'modified_graph.graphml'
tree = etree.parse(SRC_FILE)
root = tree.getroot()
# Define the namespaces
ns = {'graphml': 'http://graphml.graphdrawing.org/xmlns'}
autoload -Uz vcs_info
precmd() { vcs_info }
# Format the vcs_info_msg_0_ variable
zstyle ':vcs_info:git:*' formats '%b'
# Set up the prompt (with git branch name)
setopt PROMPT_SUBST
PROMPT='%n %F{yellow}${PWD/#$HOME/~} %F{green}${vcs_info_msg_0_} $ %f'
@sairamch04
sairamch04 / java.sublime-snippet
Created January 26, 2019 16:26
Java template for sublime text
<snippet>
<content><![CDATA[
import java.util.*;
public class ${TM_FILENAME/(.+)\..+|.*/$1/:name} {
public static void main(String[] args) {
${2:snippet}
}
}
]]></content>
create DATABASE audit;
USE audit
DROP DATABASE audit;
drop table employees;
CREATE TABLE employees
( employee_id INT PRIMARY KEY,
name VARCHAR(50)
@sairamch04
sairamch04 / SimpleHTTPServerWithUpload.py
Created December 29, 2017 03:02 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@sairamch04
sairamch04 / .gitconfig
Last active March 20, 2017 13:16
My git alias
[alias]
#checkout to different branch
co = checkout
#Find the commits which are not pushed to remote branch..equivalet to git log origin/branch..branch
unpushed = !GIT_CURRENT_BRANCH=$(git name-rev --name-only HEAD) && git log origin/$GIT_CURRENT_BRANCH..$GIT_CURRENT_BRANCH --oneline
#onlineed with ascii art in graph format
l = log --oneline --graph --decorate
@sairamch04
sairamch04 / RSAUtil.java
Last active January 22, 2017 05:39
RSA Generation of public-private key pairs , Encryption and Decryption and in Java
package com.practo.insta.qless.utils;
import android.content.Context;
import android.util.Base64;
import com.practo.insta.qless.R;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@sairamch04
sairamch04 / docker-compose.yml
Created December 31, 2016 18:23
Sample docker compose file
version: "2"
services:
spark:
build: .
#image: spark
ports:
- "8080:8080"
- "8000:8000"
volumes:
@sairamch04
sairamch04 / template.cpp
Created December 25, 2016 09:02
My c++ template for competitive programming
#include <vector>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <deque>
using namespace std;
int main(){
//freopen("input.txt", "r", stdin);
@sairamch04
sairamch04 / periscopedata_slack.py
Created December 16, 2016 08:09
Post data from periscopeData to slack using "Incoming Webhook" app of slack
# Post data from periscopedata to slack using Incoming Webhooks app of slack
import requests
import json
# URL of webhook to post data to slack
webhook_api = '<url of incoming-webhook>'
# Enable 'API-ACCESS' for charts in PeriscopeData.Enter those api's here
periscopedata_api= ['<api1 of periscope>',
'<api2 of periscope>']