Skip to content

Instantly share code, notes, and snippets.

View tareq1988's full-sized avatar
🎯
Focusing

Tareq Hasan tareq1988

🎯
Focusing
View GitHub Profile
@hungbang
hungbang / clean-docker.sh
Created August 8, 2019 04:13 — forked from marioharper/clean-docker.sh
Stop all docker processes, remove all containers, remove all images
# stop all processes
docker stop $(docker ps -aq)
# remove all containers
docker rm $(docker ps -aq)
# remove all images
docker rmi $(docker images -aq)
# delete all volumes
@nickcernis
nickcernis / readme.md
Last active June 2, 2024 18:31
Exclude node_modules and .git from Backblaze backups on Mac

Exclude node_modules and .git from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add these rules inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@ediamin
ediamin / CLI.php
Created July 7, 2018 07:28
WordPress CLI Wrapper Abstract Class
<?php
namespace MyPlugin\CLI;
/**
* Base CLI class contains wrapper APIs
*
* @since 1.0.0
*/
abstract class CLI extends \WP_CLI_Command {
@QWp6t
QWp6t / BedrockMultisiteValetDriver.php
Last active June 17, 2024 07:43
Fix Laravel Valet when using WordPress subdirectory multisite + Bedrock
<?php
namespace Valet\Drivers\Custom;
class BedrockMultisiteValetDriver extends \Valet\Drivers\Specific\BedrockValetDriver
{
/**
* Determine if the incoming request is for a static file.
*
* @return string|false
@poul-kg
poul-kg / valet.conf
Last active June 1, 2024 18:41
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@lcherone
lcherone / disposable-email-provider-domains
Last active December 26, 2021 19:02
List of disposable email provider domains
0815.ru
0815.ru0clickemail.com
0815.ry
0815.su
0845.ru
0clickemail.com
0-mail.com
0wnd.net
0wnd.org
10mail.com
@bgarrant
bgarrant / ValetSwitchPHP.md
Last active September 30, 2022 08:08
How to Switch PHP Version in Laravel Valet between PHP 7.1 and PHP 5.6

How to Switch PHP Version in Laravel Valet between PHP 7.1 and PHP 5.6

Valet switch PHP version with these commands

Install PHP 5.6 and switch Valet to PHP 5.6

valet stop
brew unlink php71
brew install php56
brew install php56-mcrypt
@ediamin
ediamin / wordpress-colorized-button.less
Last active November 7, 2016 05:39
WordPress Colorized Button
.button-colorized(@baseColor) {
background: @baseColor;
border-color: darken(@baseColor, 5%) darken(@baseColor, 9%) darken(@baseColor, 9%);
-webkit-box-shadow: 0 1px 0 darken(@baseColor, 9%);
box-shadow: 0 1px 0 darken(@baseColor, 9%);
color: #fff;
text-decoration: none;
text-shadow: 0 -1px 1px darken(@baseColor, 9%), 1px 0 1px darken(@baseColor, 9%), 0 1px 1px darken(@baseColor, 9%), -1px 0 1px darken(@baseColor, 9%);
&.hover,

Some of the Redis best practices content has moved

This content from this markdown file has moved a new, happier home where it can serve more people. Please check it out : https://docs.microsoft.com/azure/azure-cache-for-redis/cache-best-practices.

NOTE: Client specific guidance listed below is still valid and should still be considered. I will update this document once all content has been moved.

@CalebEverett
CalebEverett / events-websock.js
Last active March 29, 2023 15:04
Lxd api example: lxc exec and operations websocket via nodejs
const fs = require('fs')
const WebSocket = require('ws');
const wsoptions = {
cert: fs.readFileSync('../../.config/lxc/client.crt'),
key: fs.readFileSync('../../.config/lxc/client.key'),
rejectUnauthorized: false
}
var ws = new WebSocket('wss://127.0.0.1:8443/1.0/events?type=operation', wsoptions);