Skip to content

Instantly share code, notes, and snippets.

View Flower7C3's full-sized avatar
🪲
99 little bugs in the code, take one down, patch it around, 117 little bugs…

Bartłomiej Jakub Kwiatek Flower7C3

🪲
99 little bugs in the code, take one down, patch it around, 117 little bugs…
View GitHub Profile
@Flower7C3
Flower7C3 / time_hasher.php
Created September 12, 2017 08:48
Encode and decode time string in 36 base system
<?php
function generate_time($timeString='now'){
$datetime = new \DateTime($timeString);
$string = sprintf("%02d-%06d-%08d-%02d",
mt_rand(0,99),
$datetime->format('u'),
(
$datetime->format('z')*24*60*60
+ $datetime->format('H')*60*60
@Flower7C3
Flower7C3 / paktpub-claim.js
Last active April 15, 2017 05:16
Claim free book from PaktPub.com - just add min script as bookmark
var PaktPub = (function () {
"use strict";
var freeLearningURL = 'https://www.packtpub.com/packt/offers/free-learning',
logoutURL = 'https://www.packtpub.com/logout';
var notify = function (message, timeout) {
var useNotificationAPI = false;
if ("Notification" in window) {
if (Notification.permission === "granted") {
useNotificationAPI = true;
} else if (Notification.permission !== 'denied') {