Skip to content

Instantly share code, notes, and snippets.

View megaxorg's full-sized avatar

megax megaxorg

  • Germany
View GitHub Profile
@m-wild
m-wild / cloudflaredns.sh
Last active June 1, 2022 20:18 — forked from briped/gratisdns.sh
CloudFlare dynamic dns updater module for Synology
#!/bin/sh
# cloudflareddns.sh - dynamic dns updater module for Synology
#
# Author:
# Michael Wildman (http://mwild.me)
#
# Version:
# 0.2
#
<?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;
@sergejmueller
sergejmueller / index.html
Last active December 14, 2021 09:50
Embedded Google Analytics: Fix “Leverage Browser Caching” Warning on Nginx
<html>
<!-- ... -->
<!-- Embed analytics.js as local file -->
<script src="/analytics.js"></script>
</html>
@bueltge
bueltge / add-blog-id.php
Created October 4, 2012 09:51
View Blog and User ID in WordPress Multisite
<?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
*/
@theodorosploumis
theodorosploumis / install_php.sh
Last active November 29, 2019 11:05
Install php7 with useful extension on Ubuntu xenial 16.10
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 \
@razius
razius / chrome-refresh.sh
Last active November 6, 2018 13:50
Watches the folder or files passed as arguments to the script and when detects a change it automatically refreshes the current selected Chrome tab or window.
#!/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
@lkorth
lkorth / gist:4061732
Created November 12, 2012 20:38
Understanding PHP AES Encryption
<?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,
@ChristopherDosin
ChristopherDosin / custom.js
Created September 15, 2016 15:28
Shopware Altersabfrage Modal
// 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,
@rintoug
rintoug / opacity.css
Created March 27, 2017 14:43
Cross Browser Opacity in CSS
.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;
@Amadren
Amadren / AES-Encrypt-Sample
Created April 11, 2015 06:02
AES php encryption sample
<?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