Skip to content

Instantly share code, notes, and snippets.

View karthikraman's full-sized avatar
💭
I may be slow to respond.

Karthik Raman karthikraman

💭
I may be slow to respond.
View GitHub Profile
@nikhilweee
nikhilweee / statement-to-excel.py
Last active March 29, 2024 10:50
Convert HDFC Bank Credit Card statements from PDF to Excel
# This script is designed to convert bank statements from pdf to excel.
#
# It has been tweaked on HDFC Bank Credit Card statements,
# but in theory you can use it on any PDF document.
#
# The script depends on camelot-py,
# which can be installed using pip
#
# pip install "camelot-py[cv]"
@LanternD
LanternD / fixed_table_column_width_aligned_text_demo.tex
Created June 17, 2018 01:19
LaTeX - Fixed table column width while aligning text left/center/right
\documentclass{article}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
\begin{document}
anonymous
anonymous / app.js
Created July 28, 2017 19:34
/* This file should be in a folder called `js` */
var clock = document.getElementById('clock');
var hexColor = document.getElementById('hex-color');
function hexClock() {
var time = new Date();
var hours = (time.getHours() % 12).toString();
var minutes = time.getMinutes().toString();
var seconds = time.getSeconds().toString();
@Midnighter
Midnighter / database.dbj
Created April 13, 2015 18:34
References style for the Oxford journal Database
%% Driver file to produce database.bst from merlin.mbs
%% Generated with makebst, version 4.1 (2003/09/08)
%% Produced on 2015/04/13 at 19:37
%%
\input docstrip
\preamble
----------------------------------------
*** Reference style for the Oxford journal "Database: The Journal of Biological Databases and Curation". ***
@mikkelam
mikkelam / hamilton.py
Last active October 29, 2022 07:21
Finds a hamiltonian path using networkx graph library in Python with a backtrack solution
import networkx as nx
def hamilton(G):
F = [(G,[list(G.nodes())[0]])]
n = G.number_of_nodes()
while F:
graph,path = F.pop()
confs = []
neighbors = (node for node in graph.neighbors(path[-1])
if node != path[-1]) #exclude self loops
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@P4
P4 / default.reg
Last active April 13, 2024 05:23
Color schemes for Windows Command Prompt
Windows Registry Editor Version 5.00
; Default color scheme
; for Windows command prompt.
; Values stored as 00-BB-GG-RR
[HKEY_CURRENT_USER\Console]
; BLACK DGRAY
"ColorTable00"=dword:00000000
"ColorTable08"=dword:00808080
; BLUE LBLUE
@gotgenes
gotgenes / edgeswap.py
Created May 22, 2012 16:12
Edge swap graph.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2011-2012 Christopher D. Lasher
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
@pklaus
pklaus / clearRAM.sh
Last active January 8, 2024 08:00
A Script to Clear Cached RAM on Linux
#!/bin/bash
## Bash Script to clear cached memory on (Ubuntu/Debian) Linux
## By Philipp Klaus
## see <http://blog.philippklaus.de/2011/02/clear-cached-memory-on-ubuntu/>
if [ "$(whoami)" != "root" ]
then
echo "You have to run this script as Superuser!"
exit 1
fi