Skip to content

Instantly share code, notes, and snippets.

View chenwaichung's full-sized avatar
🎯
Focusing

Jim chenwaichung

🎯
Focusing
View GitHub Profile
@craigvantonder
craigvantonder / install-configure-letsencrypt.md
Last active April 26, 2022 08:58
Install and configure LetsEncrypt on Ubuntu Server 14.04 & 16.04 (Apache)
#!/bin/bash
# https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04
# Download the Let’s Encrypt Client
cd /usr/local/sbin
sudo wget https://dl.eff.org/certbot-auto
sudo chmod a+x /usr/local/sbin/certbot-auto
# Set Up the SSL Certificate
@iamralch
iamralch / sshtunnel.go
Last active April 16, 2023 03:07
SSH tunnelling in Golang
package main
import (
"log"
"bufio"
"time"
"os"
"fmt"
"io"
"net"
@DraTeots
DraTeots / ComPort over Network.md
Last active May 6, 2024 08:22
ComPort over Network
@mlynch
mlynch / autofocus.js
Last active August 24, 2022 15:03
AngularJS Autofocus directive
/**
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded
* templates and such with AngularJS. Use this simple directive to
* tame this beast once and for all.
*
* Usage:
* <input type="text" autofocus>
*
* License: MIT
*/
@mattes
mattes / check.go
Last active May 3, 2024 22:20
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}
@dnishimura
dnishimura / Makefile.golang
Created June 20, 2012 17:51 — forked from yanatan16/Makefile.golang
Makefile for Golang projects
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code