Skip to content

Instantly share code, notes, and snippets.

Peter Hankiewicz peter-hank

Block or report user

Report or block peter-hank

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
@peter-hank
peter-hank / gist:4049962c8ccd3abefa42e58bdd4a5266
Created Jan 10, 2018
Reddit multi-upvote for Greasemonkey
View gist:4049962c8ccd3abefa42e58bdd4a5266
// ==UserScript==
// @name Reddit multi-upvote
// @description Upvotes submissions and comments
// @include https://www.reddit.com/r/url1*
// @include https://www.reddit.com/r/url2*
// @version 1
// @grant none
// ==/UserScript==
// submissions only
@peter-hank
peter-hank / inotifyexec.py
Created Nov 1, 2017 — forked from wernight/inotifyexec.py
inotifywait helper that executes a command on file change (for Linux, put it in ~/bin/)
View inotifyexec.py
#!/usr/bin/env python
"""Use inotify to watch a directory and execute a command on file change.
Watch for any file change below current directory (using inotify via pyinotify)
and execute the given command on file change.
Just using inotify-tools `while inotifywait -r -e close_write .; do something; done`
has many issues which are fixed by this tools:
* If your editor creates a backup before writing the file, it'll trigger multiple times.
* If your directory structure is deep, it'll have to reinitialize inotify after each change.
View gist:4900bf94e8b48e1f39739e014d242d34
/etc/php/7.0/fpm/conf.d/10-mysqlnd.ini,
/etc/php/7.0/fpm/conf.d/10-opcache.ini,
/etc/php/7.0/fpm/conf.d/10-pdo.ini,
/etc/php/7.0/fpm/conf.d/15-xml.ini,
/etc/php/7.0/fpm/conf.d/20-apcu.ini,
/etc/php/7.0/fpm/conf.d/20-calendar.ini,
/etc/php/7.0/fpm/conf.d/20-ctype.ini,
/etc/php/7.0/fpm/conf.d/20-curl.ini,
/etc/php/7.0/fpm/conf.d/20-dom.ini,
/etc/php/7.0/fpm/conf.d/20-exif.ini,
View sync_json.html
<html>
<head>
<script>
function loadTextFileAjaxSync(filePath, mimeType) {
var xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET",filePath,false);
if (mimeType != null) {
if (xmlhttp.overrideMimeType) {
xmlhttp.overrideMimeType(mimeType);
}
@peter-hank
peter-hank / magento-1.9-patch-sorted-attribue-options
Created Jan 5, 2016
Sort product attribute options by the position property in Magento patch
View magento-1.9-patch-sorted-attribue-options
From 7423c3fd53926f4e8dac9ab9a4b4f65b94eaa7f7 Mon Sep 17 00:00:00 2001
From: peter-hank <peter.hankiewicz@gmail.com>
Date: Tue, 5 Jan 2016 20:11:19 +0100
Subject: [PATCH] Update Collection.php
---
.../Product/Type/Configurable/Attribute/Collection.php | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php
@peter-hank
peter-hank / Collection.php
Created Jan 5, 2016
Sort product attribute options by the position property in Magento (app/code/local/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php)
View Collection.php
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
You can’t perform that action at this time.