This file contains 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/python3 | |
from PIL import Image | |
from PIL import ImageFilter | |
import glob | |
for filename in glob.glob('*.jpg'): | |
im = Image.open(filename) | |
print("IMAGE:", filename) | |
print("SIZE :", im.size) |
This file contains 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/python3 | |
import struct | |
import binascii | |
import sys | |
if len(sys.argv) != 2: | |
print("Usage:") | |
print(" darktable_xmp_migrate_from_2_0_X_to_2_2_3.py filename") | |
print("") |
This file contains 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/python2 | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright 2017, Durachenko Aleksey V. <durachenko.aleksey@gmail.com> | |
# | |
# 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 file contains 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
const qlonglong delta = qAbs(oldValue - newValue) % qAbs(m_maximum - m_minimum); | |
if (newValue < m_minimum) { | |
newValue = m_maximum - (delta - (oldValue - m_minimum)); | |
} | |
else if (newValue > m_maximum) { | |
newValue = m_minimum + (delta - (m_maximum - oldValue)); | |
} |
This file contains 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 | |
set -e | |
SRC_PATH="/some/path/" | |
DATE=`date "+%Y%m%d_%H%M%S"` | |
CUR_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | |
FILE=`find $CUR_DIR -mindepth 1 -maxdepth 1 -type 'd' | sort -r | head -1` | |
if [ "$FILE" ]; then | |
cp -al $FILE $CUR_DIR/$DATE |
This file contains 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
CMainWindow::~CMainWindow() | |
diff --git a/examples/sndfileview_sync/src/csppsyncpeakdatasource.cpp b/examples/sndfileview_sync/src/csppsyncpeakdatasource.cpp | |
index efa6430..8f3e889 100644 | |
--- a/examples/sndfileview_sync/src/csppsyncpeakdatasource.cpp | |
+++ b/examples/sndfileview_sync/src/csppsyncpeakdatasource.cpp | |
@@ -14,8 +14,10 @@ | |
// License along with this library; if not, write to the Free Software | |
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
#include "csppsyncpeakdatasource.h" | |
+#include <math.h> |
This file contains 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 | |
set -e # abort if any command failed | |
# MP3 player must be attached to the USB | |
if [ ! -b /dev/disk/by-uuid/2408-0200 ] | |
then | |
echo "MP840 is not attached" | |
exit 1 | |
fi |
This file contains 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 | |
# usage | |
if [ "$#" -ne 1 ]; then | |
echo "Usage:" | |
echo " run_script_with_lock-dbus_in_crontab.sh <command_or_script_name>" | |
exit 1 | |
fi | |
# aliases |
This file contains 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
// usage: MyClass *MyClass = singleton<MyClass>(); | |
template <class Type> | |
inline Type *singleton() | |
{ | |
static Type *x = new Type; | |
return x; | |
} |