Skip to content

Instantly share code, notes, and snippets.

@LaurenceRawlings
LaurenceRawlings / Laravel Sail Setup.md
Last active October 9, 2024 10:15
Setup Laravel Sail from source control

Laravel Sail Setup

This is a simple script along with some useful information to help when setting up a Laravel Sail project that was cloned from source control. I made this because I could not find anywhere that explained how to do this and kept running into problems. The main issue was a problem with database authentication. It turns out that when the Docker volume is created for the database for the first time the password that is in the .env file is used, which I usually created after starting Sail for the first time. Another issue was not having access to the Sail binary to start the containers. This is solved by the script by installing the composer dependencies with a disposable container. If you follow the steps below in order you should not run into any issues. Feel free to leave a comment on this Gist if it could be improved.

How to use

@dschowta
dschowta / protobuf_struct_converter.go
Created August 6, 2020 05:55
golang: grpc: interface or map type conversion to protobuf struct using protojson .
// Conversion of interface{} or map[string]interface{} types to protobuf struct ("google/protobuf/struct.proto").
package codec
import (
"encoding/json"
structpb "github.com/golang/protobuf/ptypes/struct"
"google.golang.org/protobuf/encoding/protojson"
)
@liuran001
liuran001 / config.yaml
Last active October 9, 2024 10:13
mihomo (Clash Meta) 懒人配置
# mihomo (Clash Meta) 懒人配置
# 版本 V1.8-240904
# https://gist.github.com/liuran001/5ca84f7def53c70b554d3f765ff86a33
# https://obdo.cc/meta
# 作者: 笨蛋ovo (bdovo.cc)
# Telegram: https://t.me/baka_not_baka
# 关注我的 Telegram 频道谢谢喵 https://t.me/s/BDovo_Channel
# 修改自官方示例规则 https://wiki.metacubex.one/example/#meta
# 转载请保留此注释
# 尽量添加了较为详尽的注释,不理解的地方建议对照 虚空终端 (Clash Meta) Docs 进行理解
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active October 9, 2024 10:12
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
<?php
/**
* WordPress API for creating bbcode like tags or what WordPress calls
* "shortcodes." The tag and attribute parsing or regular expression code is
* based on the Textpattern tag parser.
*
* A few examples are below:
*
* [shortcode /]
* [shortcode foo="bar" baz="bing" /]
<?php
/**
* PHP-Shortcode is for creating bbcode like tags or what WordPress calls
* "shortcodes." The tag and attribute parsing or regular expression code is
* based on the Textpattern tag parser.
*
* A few examples are below:
*
* [shortcode /]
* [shortcode foo="bar" baz="bing" /]
@kamrul-22
kamrul-22 / shortcodes.php
Last active October 9, 2024 10:09
shortcodes
<?php
// Features Shortcode
function button_shortcode($atts){
extract( shortcode_atts( array(
'text' => 'Google',
'link' => 'http://google.com',
'style' => 'button',
@ujjawalsidhpura
ujjawalsidhpura / enable-ga-tracking-using-gtag.html
Last active October 9, 2024 10:09
web-vitals-tracking-code
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=GA_TRACKING_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){window.dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'GA_TRACKING_ID');
</script>
@joelonsql
joelonsql / PostgreSQL-EXTENSIONs.md
Last active October 9, 2024 10:08
1000+ PostgreSQL EXTENSIONs

🗺🐘 1000+ PostgreSQL EXTENSIONs

This is a list of URLs to PostgreSQL EXTENSION repos, listed in alphabetical order of parent repo, with active forks listed under each parent.

⭐️ >= 10 stars
⭐️⭐️ >= 100 stars
⭐️⭐️⭐️ >= 1000 stars
Numbers of stars might not be up-to-date.

@dteoh
dteoh / command.md
Created September 15, 2021 00:26
Interactively delete git branches locally

Delete multiple Git branches with a UI

This assumes you have installed [fzf][1].

$ git branch --no-color | fzf -m | xargs -I {} git branch -D '{}'

Press tab to mark a branch, shift-tab to unmark. Press enter and all marked branches will be deleted.