This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Recursively scan current directory for video files and check their integrity | |
# Output names of broken files to the standard error channel | |
clean() { | |
rm "$log" | |
} | |
trap clean INT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
// Run subsequent tasks for simple task-based projects | |
"key": "f7", | |
"when": "!inCMakeProject", // Avoid interference with CMakeTools which defines F7 shortcut of its own | |
"command": "workbench.action.tasks.reRunTask" | |
}, | |
{ | |
// Close results panel after project compilation/run in a way similar to Sublime Text | |
"key": "escape", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Scan space or newline delimited string list read from standard input for | |
# floating point values and sort it based on to the numbers found | |
def s2fp(s) ((s =~ /[-+]?[0-9]*\.?[0-9]+(e[-+]?[0-9]+)?/i).nil? ? 0 : $&).to_f end | |
puts ARGF.readlines.collect{|s| s.split}.flatten.sort{|a,b| s2fp(a) <=> s2fp(b)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bash tarball extractor function which replaces symlinks with real copies. | |
# Useful for platforms which do not handle symlinks well, such as MSYS(2). | |
untar() { | |
case "$1" in | |
*.tar) | |
u= | |
;; | |
*.tar.gz|*.tgz) | |
u=z | |
;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Cron-friendly shell script to fetch changes to the Dropbox folder and make notification on detected changes | |
# Uses rclone, KDE | |
{ rclone --verbose copy dropbox: ~/Dropbox 2>&1 | grep -e 'Transferred.*%'; } && kdialog --passivepopup 'Dropbox changes detected' | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CMake script template to build milti-language C/C++/Fortran executable with PkgConfig support. | |
# Replace ? with appropriate contents below. | |
# Set to the project name from which executable name will be deduced | |
project(?) | |
# Set to the space-separated list of C, C++ and Fortran sources which constitute the program | |
set(PROJECT_SOURCES ?) | |
# Set to the space-separated list of dependent PkgConfig modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### CMake project template for building Vala program | |
### Makes use of the Vala support module https://github.com/nemequ/gnome-cmake/blob/master/modules/FindVala.cmake | |
### FindVala.cmake is expected to be put alongside this file | |
# Set to the project name from which executable name will be deduced | |
project() | |
# Set to the list of C, C++ and Vala sources which constitute the program | |
set(PROJECT_SOURCES ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# File manager -specific file locations | |
# | |
# - GNOME3 (Nautilus): ~/.local/share/nautilus/scripts | |
# - Cinnamon (Nemo): ~/.local/share/nemo/scripts | |
# - MATE (Caja): ~/.config/caja/scripts | |
# Note that this file must be marked as executable with `chmod +x file_name` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copy uncorrupted video files found in current directory to the directory $1 | |
IFS=$'\n' | |
for f in `find . -iregex '.*\(avi\|wmv\|mkv\|mp4\|mov\|mpg\|mpeg\)$'`; do | |
ffmpeg -xerror -i "$f" -f null - > /dev/null 2>&1 | |
[[ $? = 0 ]] && { | |
echo "+ $f" | |
cp -p "$f" "$1" | |
} | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (ba)sh function to generate a patch between $dir and $dir.orig subdirectories found in current directory | |
2diff() { | |
orig=`find . -maxdepth 1 -type d -and \( -name '*.org' -or -name '*.orig' \) -printf '%P'` | |
base=`echo $orig | sed 's/\.\(org\|orig\)$//'` | |
LANG=C diff -urN $orig $base | |
} |
NewerOlder