Skip to content

Instantly share code, notes, and snippets.

View ShabbyX's full-sized avatar

Shahbaz Youssefi ShabbyX

View GitHub Profile
@ShabbyX
ShabbyX / reshuffle
Created October 18, 2015 23:18
Shuffle music files from subdirectories
#! /bin/bash
IFS='
' newfiles=($(find . -type f -name "*.*" | grep -v '\./[0-9]\+\.[^.]\+' | sed -e 's,^\./,,'))
oldfiles=($(find . -type f -name "*.*" | grep '\./[0-9]\+\.[^.]\+' | sed -e 's,^\./,,'))
total=0
((total=${#newfiles[@]}+${#oldfiles[@]}))
mindigits() {
@ShabbyX
ShabbyX / .gitconfig
Last active April 10, 2024 13:37
My .gitconfig
[user]
name = XXX XXX
email = XXX@XXX.XXX
signingkey = XXXXXXX
[color]
ui = auto
status = auto
[alias]
s = status
co = checkout
@ShabbyX
ShabbyX / .vimrc
Last active February 24, 2021 13:51
My .vimrc of course
set nocompatible
set exrc " enable per-directory .vimrc files
set secure " disable unsafe commands in local .vimrc files
autocmd!
" Enable spell checking for documents
au FileType tex,markdown,pandoc setlocal spell spelllang=en_us
" Set tab width and convert to space in certain files, based on the generally
" accepted format of community.
@ShabbyX
ShabbyX / read_str.c
Created April 1, 2012 19:38
Read string from FILE * (of any length)
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.