Skip to content

Instantly share code, notes, and snippets.

$('#start_date_').val(
moment(ev.date).format('YYYY-MM-DD HH:mm:ss')
);
@erlangparasu
erlangparasu / strip-all-non-ASCII.php
Created February 12, 2020 20:47
To strip all non-ASCII characters from the input string
<?php
// To strip all non-ASCII characters from the input string
$result = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $string);
// That code removes any characters in the hex ranges 0-31 and 128-255, leaving only the hex characters 32-127 in the resulting string, which I call $result in this example.
// Thanks to https://stackoverflow.com/users/6589057/junaid-masood
// Link: https://stackoverflow.com/questions/1176904/php-how-to-remove-all-non-printable-characters-in-a-string/54072059#54072059

.env

REDIRECT_HTTPS=true

config/app.php

'redirect_https' => env('REDIRECT_HTTPS', false),
@erlangparasu
erlangparasu / gist:4322f6acecf00227a4e238673ab16bc3
Created January 30, 2020 11:05
remove file from trash that was put there as root
# https://askubuntu.com/questions/507173/cannot-remove-file-from-trash-that-was-put-there-as-root/507174#507174
sudo nautilus /home/your_username/.local/share/Trash
" Look out for "Chain Issues" " Thanks it works!.
I download the mydomain-chain.pem file via the browser View Certificate menu,
then I save it in /etc/ssl/certs/ directory,
then set the chain path in /etc/apache2/sites-enabled/mydomain.https.conf,
then restart apache2.
Now the curl works :D thanks again – Erlang P
Source
https://stackoverflow.com/questions/28969538/curl-cannot-verify-wildcard-ssl-certificate-issued-by-verisign/28969917#28969917
@erlangparasu
erlangparasu / ubuntu-apt-get-install-php.sh
Last active October 23, 2021 02:29
ubuntu php sudo apt-get install php7.0 php7.1 php7.2 php7.3 php7.4
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-get install -y curl wget gnupg2 ca-certificates lsb-release apt-transport-https
sudo update-ca-certificates
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install \
php7.0 \
php7.0-bcmath \
php7.0-bz2 \
command:
'mysqld --innodb-flush-method=fsync'
@erlangparasu
erlangparasu / Fix error: docker-compose up mariadb on macOS.txt
Last active December 6, 2019 08:50
Fix error: docker-compose up mariadb on macOS
### MariaDB ##############################################
mariadb:
build:
context: ./mariadb
args:
- http_proxy
- https_proxy
- no_proxy
- MARIADB_VERSION=${MARIADB_VERSION}
https://marketplace.visualstudio.com/items?itemName=erlangparasu.goto-route-controller-laravel&ssr=false#overview