This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Crypto { | |
/** | |
* Encrypt using 3DES | |
* | |
* @param string $clear clear text input | |
* @param string $key encryption key to retrieve from the configuration, defaults to 'des_key' | |
* @param boolean $base64 whether or not to base64_encode() the result before returning | |
* | |
* @return string encrypted text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$password = "myPassword_!"; | |
$messageClear = "Secret message"; | |
// 32 byte binary blob | |
$aes256Key = hash("SHA256", $password, true); | |
// for good entropy (for MCRYPT_RAND) | |
srand((double) microtime() * 1000000); | |
// generate random iv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.your_transparent_class { | |
/* IE 8 */ | |
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; | |
/* IE 5-7 */ | |
filter: alpha(opacity=50); | |
/* Netscape */ | |
-moz-opacity: 0.5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// check if cookie exist | |
if(!Cookies.get('of_age1')) { | |
// if not open the modal | |
$.modal.open('<div style="padding:20px">'+ | |
'<p>Bist du schon über 18 Jahre alt?</p>'+ | |
'<button class="btn">Ja ich bin über 18</button>'+ | |
'</div>',{ | |
title: 'Bist du schon 18?', | |
additionalClass: 'of_age', | |
width: 300, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This PHP code snippet provides a basic understanding of | |
// PHP's AES encryption. Mirrored from here: http://www.chilkatsoft.com/p/php_aes.asp | |
// The first thing to understand is the meaning of these constants: | |
// MCRYPT_RIJNDAEL_128 | |
// MCRYPT_RIJNDAEL_192 | |
// MCRYPT_RIJNDAEL_256 | |
// You would think that MCRYPT_RIJNDAEL_256 specifies 256-bit encryption, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Watches the folder or files passed as arguments to the script and when it | |
# detects a change it automatically refreshes the current selected Chrome tab or | |
# window. | |
# | |
# http://razius.com/articles/auto-refreshing-google-chrome-on-file-changes/ | |
# | |
# Usage: | |
# ./chrome-refresh.sh /folder/to/watch /some/folder/file_to_watch.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get purge php5-common -y | |
#sudo apt-get install php7.0 php7.0-fpm php7.0-mysql -y | |
sudo apt-get install -y \ | |
php \ | |
libapache2-mod-php \ | |
php-fpm \ | |
php-mysql \ | |
php-memcached \ | |
php-pear \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Add Blog and User ID on Network | |
* Plugin URI: http://wpengineer.com/2188/view-blog-id-in-wordpress-multisite/ | |
* Description: View Blog and User ID in WordPress Multisite | |
* Version: 1.0.0 | |
* Author: Frank Bültge | |
* Author URI: http://bueltge.de | |
* License: GPLv3 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<!-- ... --> | |
<!-- Embed analytics.js as local file --> | |
<script src="/analytics.js"></script> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Router; | |
use Symfony\Bundle\FrameworkBundle\Routing\Router; | |
use Symfony\Component\Config\Loader\LoaderInterface; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface; | |
use Symfony\Component\Routing\Exception\InvalidParameterException; | |
use Symfony\Component\Routing\Exception\MethodNotAllowedException; |
OlderNewer