Skip to content

Instantly share code, notes, and snippets.

View jakubboucek's full-sized avatar
🚄
Living in trains

Jakub Bouček jakubboucek

🚄
Living in trains
View GitHub Profile
@jakubboucek
jakubboucek / openpgp.txt
Created October 7, 2017 15:01
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:dc0bc65a07fd97e3217952f6225fdc9c0bfaa273]
@jakubboucek
jakubboucek / datalayer-cental.html
Created September 9, 2017 12:00
Simpleshop - návrhy async vkládání
<head>
<script> simpleshop = [ {box:"simpleshop-form"}, {box:"simpleshop-form-second"} ]; </script>
<script src="https://static.simpleshop.cz/form-1yo2.js" async></script>
</head>
<body>
... kus stránky ...
<div id="simpleshop-form"></div>
... kus stránky mezi dvěma formuláři ...
@jakubboucek
jakubboucek / packager.php
Last active July 17, 2017 00:53
Self-downloadable package maker inPHP
<?php
/** Create PHP file with self-downloadable content regardless to file-type and server settings
@var $source Full filname of file to download
@var $target Path to save self-downloadable package
@return Package info
*/
function createDownloadablePackage($source, $target) {
$filename = basename($source);
$filesize = filesize($source);
@jakubboucek
jakubboucek / IWRGetCountriesAndLocationsWithCode.json
Last active June 5, 2017 14:58
McDonald's receipt number validator
{
"dataset": {
"schema": {
"manifest": {
"datasetname": "/Apps/SM/Survey/IWRGetCountriesAndLocationsWithCode",
"datafieldsmode": "D",
"dbsqltype": "P",
"schemaformat": "JSON",
"dataformat": "simple",
"encoding": "utf-8",
@jakubboucek
jakubboucek / Code.gs
Created May 16, 2017 10:32
AdWords Script: Filter ended campaings
/**
* Return true when id campaign ended
*
* @param {AdWordsApp.Campaign} Campaign
* @return {Boolean} True if campaign ended
*/
function isCampaignEnded(campaign){
var campaignEndDate = campaign.getEndDate();
if(campaignEndDate == null) {
return false;
@jakubboucek
jakubboucek / awsConvertSmtpCredentials.php
Last active May 2, 2018 08:15
Convert AWS IAM credentials to SMTP credentials
<?php
if (!isset($argv[1])) {
echo 'You must key as command\'s parameter' . PHP_EOL;
die(1);
}
// by https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html
$awsSecretAccessKey = $argv[1];
$version = "\x02";
@jakubboucek
jakubboucek / fileCacheGenerator.php
Last active February 23, 2016 07:39
Generátor statických do cache
<?php
class fileCacheGenerator {
private $sourceDir;
private $cacheDir;
private $cacheUrl;
public function __construct( $sourceDir, $cacheDir, $cacheUrl ) {
$this->sourceDir = $sourceDir;
$this->cacheDir = $cacheDir;
@jakubboucek
jakubboucek / format_html.php
Last active September 17, 2020 09:29
Format HTML source in PHP
<?php
$path = isset($argv[1]) ? $argv[1] : __DIR__;
$realpath = realpath($path);
echo "Thit tool is using free online formatter at www.freeformatter.com\n\n";
return HtmlFormatter::processObject($realpath);
/**
* Class HtmlFormatter
... same headers ...
<body>
<script>
var dataLayer = [];
</script>
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-N6RQJ7"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
@jakubboucek
jakubboucek / books.php
Created July 27, 2015 05:42
AWS serve private files via CloudFront
<?php
$books = array(
'Arthur-Charles-Clarke-3001-Posledni-vesmirna-Odyssea-(ID-1004-eBookEater.cz).epub',
'Arthur-Charles-Clarke-3001-Posledni-vesmirna-Odyssea-(ID-1004-eBookEater.cz).mobi',
'Bozena-Nemcova-Babicka-(ID-38-eBookEater.cz).mobi',
'Don-Miguel-Ruiz---1997-Ctyri-dohody.pdf',
'Don-Miguel-Ruiz---2006-Ctyri-dohody-pracovni-kniha.pdf',
'Don_Miguel_Ruiz_1997_ty_i_dohody_p-(1).mobi',
'Don_Miguel_Ruiz_1997_ty_i_dohody_p.mobi',
'Essential-Grammar-in-Use---big.pdf',