Skip to content

Instantly share code, notes, and snippets.

View brucewu16899's full-sized avatar

Bruce.Wu brucewu16899

  • Hsinchu, Taiwan
View GitHub Profile
@brucewu16899
brucewu16899 / navicat_reset_trial.sh
Created May 12, 2023 02:13 — forked from tuxity/navicat_premium_reset_trial.sh
Reset Navicat Premium 15/16 remaining trial days
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}
@brucewu16899
brucewu16899 / localssl.md
Created November 16, 2022 02:22 — forked from r0lodex/localssl.md
Setting Up Local SSL

Automatic

Updated 24-05-2020

NAME=$1

mkdir $NAME
cd $NAME

# Generate private key
@brucewu16899
brucewu16899 / dnsbl.sh
Created October 19, 2021 07:56 — forked from agarzon/dnsbl.sh
DNS Black List - Linux shell script (improved from: http://www.daemonforums.org/showthread.php?t=302)
#!/bin/sh
# Check if an IP address is listed on one of the following blacklists
# The format is chosen to make it easy to add or delete
# The shell will strip multiple whitespace
BLISTS="
b.barracudacentral.org
bb.barracudacentral.org
bl.deadbeef.com
bl.mailspike.net
@brucewu16899
brucewu16899 / .php-cs-fixer.php
Created September 6, 2021 06:00 — forked from pktharindu/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null],
@brucewu16899
brucewu16899 / nginx.conf
Created August 16, 2021 07:53 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@brucewu16899
brucewu16899 / podman-tips.md
Created August 16, 2021 02:22 — forked from zh4n7wm/podman-tips.md
podman tips
@brucewu16899
brucewu16899 / nginx.conf
Created July 7, 2021 12:54 — forked from ashleydw/nginx.conf
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
Vue, Laravel echo + socket.io + lumen (event, listener)
Steps:
  1. Install required npm packages
    socket.io-client laravel-echo
    
  2. Registering these two package to src/main.js file
    import Echo from 'laravel-echo'
    

window.io = require('socket.io-client')

@brucewu16899
brucewu16899 / load-vue-components-from-folder.js
Created June 7, 2021 10:19 — forked from eirikb/load-vue-components-from-folder.js
Load all Vue components from a given folder, no need for an "index.js"-file
const req = require.context('./components/', true, /\.(js|vue)$/i);
req.keys().map(key => {
const name = key.match(/\w+/)[0];
return Vue.component(name, req(key))
});
@brucewu16899
brucewu16899 / axios-catch-error.js
Created May 21, 2021 02:51 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨