Skip to content

Instantly share code, notes, and snippets.

View scriptum's full-sized avatar

Pavel Roschin scriptum

View GitHub Profile
@scriptum
scriptum / cppcheck-gimp-1.c
Created February 8, 2014 18:12
cppcheck-gimp-1
void
gimp_context_get_foreground (GimpContext *context,
GimpRGB *color)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (color != NULL);
*color = context->foreground;
}
@scriptum
scriptum / bugs
Last active August 29, 2015 13:58
Geany bugs
Bug in geanylatex plugin: with "Toggle special character replacement" option - type symbol `_`, it will result into `_\_}`
Shift column plugin bug (?): I just cant use it. It behaves very strange.
Select some text and try to use this plugin. Also it doesn't work with rectangular selections.
Too many text in description of Code navigation plugin.
Not a bug but it's hard to read and there is "TODO" thing not updated for years.
GeanyPy plugin - very non-intuitive plugin list placement!
12:14 b4n __RPG_: TL;DW (watch), but the start seems to be probably somewhat doable with snippets, wouldn't it?
12:15 b4n the numbered list stuff not, but hum
12:15 b4n ah no wait, length of the -- counts, nevermind
12:15 b4n __RPG_: BTW, about your report on geanylatex, I'm afraid I can't reproduce, which means I can't see what part is problematic
12:16 b4n __RPG_: have you a "steps to reproduce"?
12:16 b4n (or could you reproduce under GDB and print everything relevant)
12:18 Pierre has quit IRC
12:19 elextr feels weird typing std::strlen()
12:19 elextr shivvers all over
12:20 Pierre has joined #geany
@scriptum
scriptum / spellcheck bug
Created April 27, 2014 18:59
spellcheck bug
$ LC_ALL=C make
CC spellcheck_la-speller.lo
speller.c: In function 'sc_speller_check_word':
speller.c:136:2: warning: implicit declaration of function 'EMPTY' [-Wimplicit-function-declaration]
if (EMPTY(word))
^
speller.c: In function 'sc_speller_is_text':
speller.c:1021:10: error: 'SCE_POWERSHELL_COMMENTDOCKEYWORD' undeclared (first use in this function)
case SCE_POWERSHELL_COMMENTDOCKEYWORD:
^
==3177== 796 (440 direct, 356 indirect) bytes in 5 blocks are definitely lost in loss record 13,568 of 14,260
==3177== at 0x4C266ED: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3177== by 0x73D0400: g_malloc (in /usr/lib64/libglib-2.0.so.0.4000.0)
==3177== by 0x73C4145: g_key_file_get_string_list (in /usr/lib64/libglib-2.0.so.0.4000.0)
==3177== by 0x47F40C: configuration_load_session_files (keyfile.c:668)
==3177== by 0x480383: configuration_load (keyfile.c:1080)
==3177== by 0x44FB99: main (main.c:903)
@scriptum
scriptum / a.cpp
Last active August 29, 2015 14:02
LTO gcc test
#include "a.hpp"
#include "stdio.h"
void A::set(int a, int b)
{
x = a;
y = b;
}
void A::get()
{
/* http://stackoverflow.com/questions/17432502/how-can-i-measure-cpu-time-and-wall-clock-time-on-both-linux-windows */
#include <stdio.h>
/* Windows */
#ifdef _WIN32
#include <Windows.h>
static inline double get_wall_time()
{
@scriptum
scriptum / color.sh
Last active August 29, 2015 14:10
Function to colorize bash scripts
function color() {
case $1 in
red) tput setaf 1;;
green) tput setaf 2;;
yellow) tput setaf 3;;
blue) tput setaf 4;;
purple) tput setaf 5;;
cyan) tput setaf 6;;
white) tput setaf 7;;
#bold
@scriptum
scriptum / pdfoptimize.sh
Created November 25, 2014 14:20
PDF optimization script
for f in "$@"
do
TMP=$(mktemp)
SIZE_OLD=$(wc -c < "$f")
echo "Optimizing '$f' of size $SIZE_OLD"
/usr/bin/gs \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/ebook \
-dNOPAUSE \
/****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2013 Intel Corporation
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage