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
  • 07:56 (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 / resumable-download.php
Created May 15, 2020 13:27 — forked from kosinix/resumable-download.php
PHP - resumable download
<?php
class ResumeDownload {
private $file;
private $name;
private $boundary;
private $delay = 0;
private $size = 0;
function __construct($file, $delay = 0) {
if (! is_file($file)) {
@slackero
slackero / git-export-changes-between-two-commits.md
Created June 27, 2022 16:43 — forked from zilongshanren/git-export-changes-between-two-commits.md
Git command to export only changed files between two commits

Use case : Imagine we have just created a project with composer create-project awesone-project (currently V0.2). 2 weeks later, there is a new release (V0.3). How to update your project ? Since composer update only updates the project dependencies, it is not what we are looking for. Composer doesn't know about awesome-project since it's not in our composer.json.

After trying many git solutions, I've come to this :

git archive --output=changes.zip HEAD $(git diff --name-only SHA1 SHA2 --diff-filter=ACMRTUXB)

This command will check for changes between the two commits and ignore deleted files.

@slackero
slackero / google_search_maps_addon.user.js
Last active March 4, 2024 06:04 — forked from healla/google_search_maps_addon.user.js
Bring back the google maps button when searching on google
// ==UserScript==
// @name Google maps addon
// @namespace http://tampermonkey.net/
// @version 2024-02-29
// @description Bring google maps button back
// @author You
// @match https://www.google.com/*
// @icon data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22currentColor%22%20class%3D%22bi%20bi-geo-alt-fill%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20d%3D%22M8%2016s6-5.686%206-10A6%206%200%200%200%202%206c0%204.314%206%2010%206%2010m0-7a3%203%200%201%201%200-6%203%203%200%200%201%200%206%22%2F%3E%3C%2Fsvg%3E
// @grant none
// ==/UserScript==