Skip to content

Instantly share code, notes, and snippets.

View Myzel394's full-sized avatar

Myzel394

View GitHub Profile
@xombiemp
xombiemp / lndir.sh
Last active March 19, 2025 14:22
This script will allow you to effectively hard link a directory. It reproduces the directory structure of the source in the destination and then recursively hard links all the files from the source to the corresponding location in the destination. If you've ever wanted to hard link a folder, this produces the results you want.
#!/bin/bash
oldifs=$IFS
IFS='
'
[ $# -ne 2 ] && { echo "Usage: $0 sourceDirectory destinationDirectory" ; exit 1; }
[ ! -d "$1" ] && { echo "$1 is not a valid directory"; exit 1; }
[ ! -d "$2" ] && { mkdir -p "$2"; }
src=$(cd "$1" ; pwd)
dst=$(cd "$2" ; pwd)
find "$src" -type d |
@djangofan
djangofan / test.xml
Created July 27, 2012 04:46
XML file sample
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root testAttr="testValue">
<result>
<child>data1</child>
<child>A1343358848.646</child>
<child>
<internal>
<data>one</data>
<data>two</data>
<unique>Z1343358848.646</unique>
@shhong
shhong / nsb_entropy.py
Last active June 21, 2025 13:40
NSB entropy in python
#!/usr/bin/env python
"""
nsb_entropy.py
June, 2011 written by Sungho Hong, Computational Neuroscience Unit, Okinawa Institute of
Science and Technology
May, 2019 updated to Python 3 by Charlie Strauss, Los Alamos National Lab
This script is a python version of Mathematica functions by Christian Mendl