Skip to content

Instantly share code, notes, and snippets.

View aditya95sriram's full-sized avatar

Aditya Sriram aditya95sriram

View GitHub Profile
@aditya95sriram
aditya95sriram / allband.sh
Created June 27, 2017 14:09
Extracts wavefunction for multiple bands using pp.x from Quantum Espresso.
#!/bin/bash
#------------------------------------------------------------------------------
# Shell script: allband.sh
#------------------------------------------------------------------------------
#
# Description:
# Extracts wavefunction for multiple bands using pp.x from Quantum Espresso.
#
#------------------------------------------------------------------------------
#
@aditya95sriram
aditya95sriram / setlocq.py
Last active June 27, 2017 13:48
Port of Quantum Espresso's setlocq routine
#------------------------------------------------------------------------------
# Function: setlocq
#------------------------------------------------------------------------------
#
# Description:
# Port of Quantum Espresso's 'setlocq' routine (PHonon/PH/setlocq.f90)
#
#------------------------------------------------------------------------------
#
# What does it do:
@aditya95sriram
aditya95sriram / cubetools.py
Last active December 7, 2023 00:35
Python module to work with Gaussian cube format files
#------------------------------------------------------------------------------
# Module: cubetools
#------------------------------------------------------------------------------
#
# Description:
# Module to work with Gaussian cube format files
# (see http://paulbourke.net/dataformats/cube/)
#
#------------------------------------------------------------------------------
#
@aditya95sriram
aditya95sriram / dat2xml.sh
Last active June 23, 2017 15:13
Converts all .dat binary files output by Quantum Espresso to human readable .xml using IOTK
# Script to convert binary data in .dat files to .xml files
# using Quantum Espresso Input Output Toolkit (iotk)
# =========================================================
#
# NOTE: Set IOTK directory on line 24 before using
# e.g. <espresso>/bin/iotk, where <espresso> is the path to Quantum Espresso
#
# Recommended Usage:
# - Place script in home directory (optional)
# - navigate to *.save directory generated by Espresso
@yig
yig / Latex space saving tricks
Last active December 5, 2024 15:39
Latex space saving tricks
%% Make everything look better.
%% http://tex.stackexchange.com/questions/553/what-packages-do-people-load-by-default-in-latex
%% http://www.howtotex.com/packages/9-essential-latex-packages-everyone-should-use/
\usepackage{microtype}
%% Shrink space around figures.
%% This beats manually adding negative \vspace commands everywhere.
%\setlength{\textfloatsep}{0pt}
%\setlength{\textfloatsep}{20pt plus 2pt minus 4pt}
%\setlength{\textfloatsep}{10pt plus 2pt minus 4pt}
@jiggzson
jiggzson / scientificToDecimal.js
Last active August 22, 2024 05:03
Converts a javascript number from scientific notation to a decimal string
/**
* Removes the minus sign from the beginning of the string
*
* @param str
* @returns an array with the first item as true if a minus
* was found and the string minus the minus sign.
*/
function stripSign(str) {
// Check if it has a minus sign
let hasMinus = str.charAt(0) === '-';
@gabrielfalcao
gabrielfalcao / tcp-socket-error-codes-errno.txt
Last active February 19, 2025 18:47
TCP socket error codes
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error