Skip to content

Instantly share code, notes, and snippets.

Avatar

megax megaxorg

  • Germany
View GitHub Profile
@maheshmnj
maheshmnj / bottomnavbar.dart
Last active Nov 20, 2022
Everything about the Nested bottom navigation bar
View bottomnavbar.dart
/*
* 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
* -----
*/
View OwnRouter.php
<?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 Sep 15, 2022
JavaScript nl2br & br2nl functions
View js-nl2br-br2nl.md

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

View check_authorization.php
<?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 Feb 6, 2022
Symfony 4 ~ .htaccess
View .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 Mar 27, 2017
Cross Browser Opacity in CSS
View opacity.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 Sep 15, 2016
Shopware Altersabfrage Modal
View custom.js
// 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 Dec 14, 2021
Embedded Google Analytics: Fix “Leverage Browser Caching” Warning on Nginx
View index.html
<html>
<!-- ... -->
<!-- Embed analytics.js as local file -->
<script src="/analytics.js"></script>
</html>
@theodorosploumis
theodorosploumis / install_php.sh
Last active Nov 29, 2019
Install php7 with useful extension on Ubuntu xenial 16.10
View install_php.sh
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 \
@Amadren
Amadren / AES-Encrypt-Sample
Created Apr 11, 2015
AES php encryption sample
View AES-Encrypt-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