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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / openpgp.txt
Created October 7, 2017 15:02
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 / openpgp.txt
Created October 7, 2017 15:02
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 / openpgp.txt
Created October 7, 2017 15:02
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]