Skip to content

Instantly share code, notes, and snippets.

Avatar

Peeter Marvet petskratt

View GitHub Profile
View e-smaspaev.php
<?php
/**
* HTTP 1.1 vs HTTP/2 test
* User: petskratt
* Date: 06/05/16
* Time: 12:53
*/
$merchants = [
'kuivtoit.ee' => '/img/Kuivtoit2.jpg',
@petskratt
petskratt / xkcd_pwd_gen.php
Last active Oct 16, 2021
Generate xkcd style password using most common 1000 Estonian words (Ansip and Savisaar excluded)
View xkcd_pwd_gen.php
<?php
/*
* Generate xkcd style password using most common 1000 Estonian words (Ansip and Savisaar excluded)
* based on http://www.eki.ee/tarkvara/wordlist/soned2013_top1000.txt (removed names, countries, words with umlauts)
*
* http://xkcd.com/936/
*/
function xkcd_password_generator() {
@petskratt
petskratt / robots.txt
Last active Mar 22, 2021
Magento robots.txt
View robots.txt
# robots.txt for Magento 1.9.x / v1.6 2018-08-19 / Peeter Marvet
# (original version from 2015, edited in 2017 to add filter query parameter disallow samples + some wildcards,
# edited in 2018 to add query params blocking to Yandex as named User-agent does not read *)
# based on:
# http://inchoo.net/ecommerce/ultimate-magento-robots-txt-file-examples/
# http://www.byte.nl/blog/magento-robots-txt/
# https://astrio.net/blog/optimize-robots-txt-for-magento/
#
# comment and clone at https://gist.github.com/petskratt/016c9dbf159a81b9d6aa
# Keep in mind that by standard robots.txt should NOT contain empty lines, except between UA blocks!
@petskratt
petskratt / Codeacademy-edit-bookmarklet.md
Last active Aug 29, 2015
Edit Exercise bookmarklet for Codeacademy
View Codeacademy-edit-bookmarklet.md

Bookmarklet for easy access to edit mode on Codeacademy course exercises (where you have author / contributor rights).

Based on SCT viewer.

Drag editCA to the bookmarks bar, edit to replace the target with this code.

@petskratt
petskratt / wp-config-sample.php
Created Feb 1, 2013
WordPress config file that I have been using in both dev and live - based on innumerable examples... that I'll try to recall and properly attribute later.
View wp-config-sample.php
<?php
define( 'PROD_HOST', '' );
define( 'CURRENT_HOST', $_SERVER['SERVER_NAME'] );
define( 'CURRENT_IP', $_SERVER['SERVER_ADDR'] );
define( 'WP_DEBUG', false ) ;
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );
$table_prefix = 'wp_';