Skip to content

Instantly share code, notes, and snippets.

View slackero's full-sized avatar
:octocat:
Working from home

Oliver Georgi slackero

:octocat:
Working from home
  • At home in Europe
  • 12:59 (UTC +02:00)
  • X @slackero
View GitHub Profile
<?php
/******************************************/
// db_utf8_fix.php //
// Original author: J. van Hemert //
// Original Date: 26-10-2011 //
// //
// Fixes encoding when utf-8-encoded data //
// is stored in tables with other (e.g. //
// latin_swedish_ci) encoding. //
// Will convert all columns in all tables //
@slackero
slackero / jquery.touchclick.js
Created December 22, 2015 10:33 — forked from comm1x/jquery.touchclick.js
jQuery event touchclick
$.event.special.touchclick = {
setup : function(data) {
var elt = $(this);
elt.data($.extend({
sens : 25 // Available touch offset in pixels
}, data));
elt.bind("touchstart", $.event.special.touchclick.onTouchstart);
elt.bind("touchend", $.event.special.touchclick.onTouchend);
@slackero
slackero / twitter.cards.php
Last active June 15, 2016 14:59
Twitter Cards frontend render script for phpwcms
<?php
/**
* Twitter Cards frontend render script for phpwcms
*
* Use it in combination with [X] social sharing checkbox to mix
* OpenGraph meta tags with Twitter Cards Markup Tags and optional
* HTML comment to define type of Twitter Card (e.g. template)
* like <!--TWITTER:summary_large_image-->
*
* @see https://dev.twitter.com/cards/getting-started Documentation of Twitter Cards
@slackero
slackero / phpwcmsfixarticledate.php
Created July 19, 2016 16:09
Articles in phpwcms auto expired by December 31, 2010? Then use this script to fix the article kill date (and the historical bug).
<?php
/*************************************************************************************
Copyright notice
(c) 2002-2011 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
This script is part of PHPWCMS. The PHPWCMS web content management system 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 2 of the License, or (at your option) any later version.
@slackero
slackero / oxtheme_duplicate_settings.php
Last active January 24, 2017 14:24
Duplicate existing OXID theme settings for another theme of your choice.
<?php
/**
* $Id$
*
* Duplicate Theme settings for another Theme
* Script is a just a quick fix for current Oxid versions (4.10.0 tested)
* and based on the script of forum member "stefan2"
* http://forum.oxid-esales.com/showthread.php?t=9393&page=2#post55919
*
*/
@slackero
slackero / install-parallels-tools-ubuntu
Created May 5, 2017 05:02
Install/Update Parallels Tools Ubuntu
sudo mount -o exec /dev/cdrom /media/cdrom
cd /media/cdrom
sudo install
@slackero
slackero / UbuntuPleskVhosts
Last active June 28, 2017 22:16
Ubuntu 14.04 with Plesk 12: move /var/www/vhosts to another location
Use "sudo command" or as root user:
===================================
In this example /var/www/vhosts is moved to /data/www/vhosts on another partition. Change all steps as your needed for your location.
1) Stop services
~# /etc/init.d/psa stopall
OR
~# /etc/rc.d/init.d/psa stopall
@slackero
slackero / pcdtojpeg.md
Last active October 6, 2017 11:20
Recursive batch convert Kodak Photo CD PCD to JPEG with pcdtojpeg

How to batch convert PCD to JPEG

Kodak Photo CD support has almost gone, so the best and easy way to convert all PCD images to some more handy JPEG is to use the Photo CD Decoder pcdtojpeg. More information can be found on the project web site.

The terminal command will convert every *.PCD starting at current directory and subdirectories:

find . -name '*.PCD' -exec pcdtojpeg -q 100 -r 5 {} \;
@slackero
slackero / twbs-auto-pagination.html
Last active June 29, 2018 13:41
Auto paginate DOM elements and paginate through it using twbs-pagination http://esimakin.github.io/twbs-pagination/
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
$ su
$ umount /media/cdrom
$ mount /dev/sr0 /media/cdrom
$ cd /media/cdrom
$ ./install