Skip to content

Instantly share code, notes, and snippets.

View SmetDenis's full-sized avatar
🏠
Working at home

Denis Smet SmetDenis

🏠
Working at home
View GitHub Profile
<?php
// no cache
if (!headers_sent()) {
header('Expires: Wed, 11 Jan 1984 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
}
@SmetDenis
SmetDenis / i-miss-you.js
Created October 1, 2015 11:06
"I miss you" on tab if it's not active
var Z63 = Z63 || {};
Z63.ChangePageTitle = function (e) {
"use strict";
var t = {}, n, r;
t.init = function (e) {
n = e.title;
r = e.originalTitle;
t.listenToChange()
};
t.listenToChange = function () {
<?php
/**
* JBZoo App is universal Joomla CCK, application for YooTheme Zoo component
* @package jbzoo
* @version 2.x Pro
* @author JBZoo App http://jbzoo.com
* @copyright Copyright (C) JBZoo.com, All rights reserved.
* @license http://jbzoo.com/license-pro.php JBZoo Licence
* @coder Denis Smetannikov <denis@jbzoo.com>
*/
@SmetDenis
SmetDenis / merge.php
Created March 18, 2016 09:54
merge phpunit cover.php
<?php
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
require_once './vendor/autoload.php';
$finder = new Finder();
@SmetDenis
SmetDenis / ignores.php
Last active October 9, 2020 14:00
Ignores for PHP inspections
<?php
// https://pear.php.net/manual/en/package.php.php-codesniffer.advanced-usage.php
// @codingStandardsIgnoreLine
// @codingStandardsIgnoreFile
// @codingStandardsIgnoreStart
// @codingStandardsIgnoreEnd
// https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.codeCoverageIgnore
// @codeCoverageIgnore
@SmetDenis
SmetDenis / flash-to-pc.bat
Created March 23, 2016 17:49
flash and pc sync (manual)
@ECHO OFF
setlocal
:PROMPT
SET /P AREYOUSURE=Copy to PC? (PC/[N])?
IF /I "%AREYOUSURE%" NEQ "PC" GOTO END
DEL c:\vhd\work_old.vhd
REN c:\vhd\work.vhd work_old.vhd
@SmetDenis
SmetDenis / remove_win_10_updates.bat
Created March 23, 2016 17:51
Remove Windows 10 updates script
wusa /uninstall /kb:2952664 /norestart /quiet
wusa /uninstall /kb:2976978 /norestart /quiet
wusa /uninstall /kb:2977759 /norestart /quiet
wusa /uninstall /kb:2990214 /norestart /quiet
wusa /uninstall /kb:3021917 /norestart /quiet
wusa /uninstall /kb:3022345 /norestart /quiet
wusa /uninstall /kb:3035583 /norestart /quiet
wusa /uninstall /kb:3044374 /norestart /quiet
wusa /uninstall /kb:3068708 /norestart /quiet
wusa /uninstall /kb:3075249 /norestart /quiet
#!/usr/bin/env sh
#######################################################################
assert () # If condition false,
{ #+ exit from script
#+ with appropriate error message.
E_PARAM_ERR=98
E_ASSERT_FAILED=99
#!/usr/bin/env sh
------------------------------------------
openssl genrsa -out jbzoo-com-ca.key 2048
openssl req -x509 -new -key jbzoo-com-ca.key -days 10000 -out jbzoo-com-ca.crt
openssl genrsa -out jbzoo-com-server.key 2048
openssl req -new -key jbzoo-com-server.key -out jbzoo-com-server.csr
openssl x509 -req -in jbzoo-com-server.csr -CA jbzoo-com-ca.crt -sha256 -CAkey jbzoo-com-ca.key -CAcreateserial -out jbzoo-com-server.crt -days 5000
#!/bin/bash
# Delete all containers
docker rm -f $(docker ps -a -q)
# Delete all images
docker rmi -f $(docker images -q)
# Enter to container
docker run -ti <IMAGE> /bin/bash