Skip to content

Instantly share code, notes, and snippets.

View brablc's full-sized avatar

Ondrej Brablc brablc

View GitHub Profile
@brablc
brablc / shoptet-addon-html-codes-example.html
Last active July 7, 2019 18:20
Shoptet add-on HTML codes example
<script type="text/javascript">
var demoPartner = { 'host': '#HOST#', 'projectId': #PROJECT_ID#, 'template': '#TEMPLATE#' };
</script>
<script src="https://cdn.myshoptet.com/usr/demo-partner.myshoptet.com/user/documents/addon_1/common.js" type="text/javascript"></script>
<link href="https://cdn.myshoptet.com/usr/demo-partner.myshoptet.com/user/documents/addon_1/#TEMPLATE#.css" rel="stylesheet" />
<link href="https://cdn.myshoptet.com/usr/demo-partner.myshoptet.com/user/documents/addon_1/#HOST#/style.css?v=1" rel="stylesheet" />
@brablc
brablc / dnsmasq macOS.md
Last active September 24, 2021 10:24 — forked from ogrrd/dnsmasq OS X.md
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@brablc
brablc / katalog.xsl
Created December 10, 2016 13:29
Shoptet Katalog XML Stylesheet
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
method="html"
version="4.01"
encoding="utf-8"
indent="yes"
omit-xml-declaration="yes"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" />
<xsl:template match="/">
@brablc
brablc / katalog.xml
Created December 10, 2016 13:24
Shoptet Katalog
= Hlavicka XML
<?xml-stylesheet href="https://beta.shoptet.cz/user/documents/katalog.xsl" type="text/xsl"?>
<SHOP>
= Tělo XML
<SHOPITEM>
<PRODUCT>#NAME#</PRODUCT>
<ITEM_ID>#CODE#</ITEM_ID>
@brablc
brablc / from-macOS-utf8.sh
Last active November 6, 2016 18:50
macOS filesystem uses decomposed utf8 characters, they look the same but have different byte representation
iconv -f utf8-mac -t utf8
@brablc
brablc / Shoptet Admin Background Color.js
Created September 27, 2016 09:32
Tamper Monkey - Shoptet Admin Background Color.js
// ==UserScript==
// @name Shoptet Admin Background Color
// @namespace https://www.shoptet.cz/
// @version 0.1
// @description change bg color for admin!
// @author brablc
// @match https://beta.shoptet.cz/admin/*
// ==/UserScript==
(function() {
@brablc
brablc / GoogleTranslate.html
Created August 1, 2016 15:05
Google Translate Snippet
<div id="google-tr">
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'cs'
}, 'google_translate_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
if query == nil then
s = "users"
else
-- Remove part before @
s = string.gsub( query, ".*@", "")
-- Remove dots from selector
s = string.gsub( s, "%.", "_")
end
d = "smtp.shoptet.cz"
@brablc
brablc / pflogrep
Last active April 17, 2016 19:07
Grep Postfix MTA log for given email (or part of email) and all related communication
Moved to a repository:
https://github.com/brablc/postfix-tools
@brablc
brablc / import_contacts_from_groupoffice_to_roundcube.sql
Created April 9, 2016 19:21
Import address book to RoundCube from Group Office using SQL
-- ALTER TABLE roundcube.contacts ADD UNIQUE INDEX `uniq_email_user_id` (`email` (128), `user_id`);
SET @CrLf='\r\n';
SET sql_mode='PIPES_AS_CONCAT';
INSERT IGNORE roundcube.contacts
SELECT
NULL contact_id,
changed,
0 del,
IF(firstname,firstname || ' ','') || surname name,