Skip to content

Instantly share code, notes, and snippets.

@onli
onli / functions_images.inc.php
Created Jul 31, 2020
with caching for traversePath
View functions_images.inc.php
<?php
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
if (IN_serendipity !== true) {
die ("Don't hack!");
}
/**
* Check if an uploaded file is "evil"
View linuxdeploy_plugin_ruby.sh
#! /bin/bash
# abort on all errors
set -e
if [ "$DEBUG" != "" ]; then
set -x
fi
script=$(readlink -f "$0")
@onli
onli / mysqli.inc.php
Created Mar 23, 2020
After my changes, with charset debug
View mysqli.inc.php
<?php
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
/**
* Tells the DB Layer to start a DB transaction.
*
* @access public
*/
function serendipity_db_begin_transaction(){
@onli
onli / mysqli.inc.php
Created Mar 23, 2020
Before my changes, with charset debug output
View mysqli.inc.php
<?php
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
/**
* Tells the DB Layer to start a DB transaction.
*
* @access public
*/
function serendipity_db_begin_transaction(){
@onli
onli / izulu-1.1
Created Apr 23, 2017
izulu with KDE plasma detection
View izulu-1.1
#!/bin/bash
# izulu - Change the wallpaper according to the weather
#
# Copyright (C) 2009 Malte Paskuda
#
# 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.
View electedOrderedList.rb
class ElectedOrderedListItem
# subitem: the item itself, the payload
# lowerItems: A list of items that were seen before this item
# seen: How often it was seen before
# rating: rating to store if there is no other way
attr_accessor :payload, :rating, :seen, :lowerItems
def initialize(payload, rating)
View testMaybeOrderedList.rb
require './maybeOrderedList.rb'
mol = MaybeOrderedList.new()
itemsA = [['a', 10], ['c', 1], ['b', 5]]
itemsA.each do |item, value|
mol.add(item, value)
end
puts 'mol'
View maybeOrderedList.rb
# mol: A maybe ordered list, by preserving some order on merge
#
# Concept:
# We have an ordered list with values. If another list shall be merged in,
# merge each new item below an item known in both lists that has a higher
# value (=big brother), or above one that has a smaller value. If there
# exists no such item, use the item value to find a higher item, and
# insert below. When adding an item that exists already, average its value
# and reposition as if it were a new item.
#
@onli
onli / make.log
Created Oct 4, 2016
radeon-profile build fail
View make.log
onli@Fallout:~/.../radeon-profile/radeon-profile$ qmake && make
/usr/lib64/qt4/bin/uic radeon_profile.ui -o ui_radeon_profile.h
g++ -c -pipe -std=c++11 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
g++ -c -pipe -std=c++11 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o radeon_profile.o radeon_profile.cpp
g++ -c -pipe -std=c++11 -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG_OUTPUT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/u
View izulu
#!/bin/bash
# izulu - Change the wallpaper according to the weather
#
# Copyright (C) 2009 Malte Paskuda
#
# 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.
You can’t perform that action at this time.