Skip to content

Instantly share code, notes, and snippets.

Michal Fapso michalfapso

Block or report user

Report or block michalfapso

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@michalfapso
michalfapso / main.cpp
Last active Mar 4, 2019
How to automatically increase/decrease text size in label in Qt - comment on https://stackoverflow.com/a/42690033/1341914
View main.cpp
// standard C++ header:
#include <iostream>
#include <string>
// Qt header:
#include <QApplication>
#include <QBoxLayout>
#include <QFrame>
#include <QGroupBox>
#include <QLabel>
@michalfapso
michalfapso / mac_fix_tbd_libraries.sh
Last active Feb 28, 2018
After upgrading to XCode 8 and MacOS to 10.12.2, I was getting a linker error when linking with macport's GCC 6: "ld: unexpected token: !tapi-tbd-v2", so this script creates a lybrary symlink for every .tbd file in a given MacOSX SDK path, so that the linker doesn't need the .tbd file at all.
View mac_fix_tbd_libraries.sh
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 MACOSX_SDK_PATH"
echo "Example: $0 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk"
exit 1
fi
for tbd in $(find -L "$1" -name '*.tbd'); do
@michalfapso
michalfapso / strip_lib.sh
Created Mar 3, 2016
Stripping symbols from a static library archive overcoming the error: "strip.exe: cannot create tempdir for archive copying (error: File exists)", when the library contains more than a few object files. The problem is in mktemp("stXXXXXX") which is able to create only 26 unique filenames on the MinGW system "mingw32_4.9.2-posix-sjlj-rt_v3-rev1"
View strip_lib.sh
#!/bin/bash
if [ $# -lt 2 ]; then
echo "Usage: $0 LIB_IN LIB_OUT STRIP_PARAMS"
echo "Example: $0 mylib_debug.a mylib_release.a --strip-debug"
fi
LIB_IN="$1"; shift;
LIB_OUT="$1"; shift;
LIB_IN="`realpath "$LIB_IN"`"
@michalfapso
michalfapso / aa_float.cpp
Last active Aug 29, 2015
AntiGrainGeometry simple float antialiasing
View aa_float.cpp
// Compiling:
//
// just put this file into agg24/examples and run:
// g++ -DRECT_X=1 -DRECT_Y=1 -DAGG_GRAY16 -I. -I../include -g -O2 -o aa_float aa_float.cpp
#if !defined(AGG_GRAY8) && !defined(AGG_GRAY16) && !defined(AGG_GRAY32)
#define AGG_GRAY32
#endif
#if defined(AGG_GRAY8)
@michalfapso
michalfapso / aa_demo_agg24.cpp
Last active Aug 29, 2015
AntiGrainGeometry demo modified to visualize polygon stitching (AGG 2.4)
View aa_demo_agg24.cpp
#include "agg_basics.h"
#include "agg_rendering_buffer.h"
#include "agg_rasterizer_scanline_aa.h"
#include "agg_scanline_u.h"
#include "agg_renderer_scanline.h"
#include "agg_pixfmt_rgb.h"
#include "platform/agg_platform_support.h"
#include "ctrl/agg_slider_ctrl.h"
#include "ctrl/agg_cbox_ctrl.h"
@michalfapso
michalfapso / aa_demo.cpp
Created Mar 5, 2014
AntiGrainGeometry demo modified to visualize polygon stitching
View aa_demo.cpp
#include "agg_basics.h"
#include "agg_rendering_buffer.h"
#include "agg_rasterizer_scanline_aa.h"
#include "agg_scanline_u.h"
#include "agg_renderer_scanline.h"
#include "agg_pixfmt_rgb.h"
#include "platform/agg_platform_support.h"
#include "ctrl/agg_slider_ctrl.h"
#include "ctrl/agg_cbox_ctrl.h"
@michalfapso
michalfapso / speak.pl
Last active Sep 11, 2018
Google Text-to-Speech script for processing longer texts
View speak.pl
#!/usr/bin/perl
#--------------------------------------------------
# Usage:
# ./speak.pl en input.txt output.mp3
#
# Prerequisites:
# sudo apt-get install libwww-perl libhtml-tree-perl sox libsox-fmt-mp3
#
# Compiling sox:
@michalfapso
michalfapso / emailAddressVerifier.pl
Created May 21, 2012
emailAddressVerifier.pl: Script for verification of a list of email addresses
View emailAddressVerifier.pl
#!/usr/bin/perl
use Email::Valid;
use WWW::Mechanize;
use LWP::UserAgent;
#use Thread qw/async yield/;
use threads;
use threads::shared;
You can’t perform that action at this time.