Skip to content

Instantly share code, notes, and snippets.

View megaxorg's full-sized avatar

megax megaxorg

  • Germany
View GitHub Profile
@maheshmnj
maheshmnj / bottomnavbar.dart
Last active September 2, 2023 11:53
Demo app for a medium post "Everything about the Nested bottom navigation bar"
/*
* File: main.dart
* Project: BottomNavigationBar demo
* File Created: Wednesday, 26th May 2022 1:15:47 pm
* Author: Mahesh Jamdade
* -----
* Last Modified: Saturday, 28th May 2022 4:42:07 pm
* Modified By: Mahesh Jamdade
* -----
*/
<?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;
@yidas
yidas / js-nl2br-br2nl.md
Last active September 29, 2023 05:26
JavaScript nl2br & br2nl functions

JavaScript nl2br & br2nl functions

The exchange of new line & br HTML tag could refer to PHP - nl2br() function, which uses to inserts HTML line breaks before all newlines in a string.

These JavaScript functions consider whether to use insert or replace to handle the swap.

nl2br

@5car1z
5car1z / jail.local
Created May 18, 2018 15:57
Fail2ban Jail configuration file; for an Ansible playbook example.
[DEFAULT]
# email address to receive notifications.
destemail = root@localhost
# the email address from which to send emails.
sender = root@<fq-hostname>
# name on the notification emails.
sendername = Fail2Ban
# email transfer agent to use.
mta = sendmail
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@Guibzs
Guibzs / .htaccess
Last active March 26, 2023 15:17
Symfony 4 ~ .htaccess
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule !mod_rewrite.c>
<IfModule mod_alias.c>
RedirectMatch 302 ^/$ /index.php/
@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;
@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,
@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>
@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 \