Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing

Benny Sun Haogood

:octocat:
Focusing
Block or report user

Report or block Haogood

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Haogood
Haogood / Conky-Network-Panel
Last active Jul 20, 2019
擴充網路卡監聽狀態,例如本來使用wifi,改連有線網路後,自動切換對應流量及IP
View Conky-Network-Panel
# **********************************************************************
# "CPU Panel (8-core)" theme for Conky by Tony George (teejee2008@gmail.com)
#
# Webpage: http://teejeetech.blogspot.in/
# **********************************************************************
background yes
double_buffer yes
@Haogood
Haogood / nvidia-elementaryos-loki.md
Created Dec 21, 2018 — forked from Jiab77/nvidia-elementaryos-loki.md
nVidia drivers installation on ElementaryOS - Loki (ubuntu 16.04 based distrib)
View nvidia-elementaryos-loki.md

nVidia drivers installation on ElementaryOS - Loki

Introduction

ElementaryOS - Loki is an amazing ubuntu based distribution, I've just felt in love on it BUT they've removed what's required to install easily the nVidia Proprietary drivers. So here is the reason of this gist, to store the install instructions in one place inside a crystal clear documentation.

Check your device

@Haogood
Haogood / prevent-double-submission.js
Created Aug 29, 2018
Prevent form double submission with vanilla js
View prevent-double-submission.js
var form = document.getElementById("form1")
form.addEventListener("submit", function (e) {
if (true === this.isSubmit) {
e.preventDefault()
} else {
this.isSubmit = true
}
})
@Haogood
Haogood / imap-attachment.php
Created Feb 26, 2018 — forked from hakre/imap-attachment.php
Save attachments from imap messages to disk.
View imap-attachment.php
<?php
/**
* imap-attachment.php
*
* @author hakre <hakre.wordpress.com>
* @link http://stackoverflow.com/questions/9974334/how-to-download-mails-attachment-to-a-specific-folder-using-imap-and-php
*/
/**
* Utility Class
@Haogood
Haogood / a2dp.py
Created Feb 23, 2018 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
View a2dp.py
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
@Haogood
Haogood / regex.js
Created Jun 25, 2017
input validation regex
View regex.js
var regex = {
Name: /^([\u4e00-\u9fa5A-z\s]{0,})$/,
Mobile: /^(09\d{2})?((\+)?886\d{3})?-?\d{3}-?\d{3}$/,
Tel: /^(0\d+)-?(-?[\d{7,8}])+(?:(?:#)(\d+))?$/,
Address: /^[^;'<>@#\$%\^&\*]+$/,
Email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
Integer: /^[+\-]?\d+$/,
PositiveInt: /^\d+$/,
Numeric: /[0-9]+.[0-9]+/,
Url: /(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/,
You can’t perform that action at this time.