Skip to content

Instantly share code, notes, and snippets.

Avatar

Levi Durfee levidurfee

View GitHub Profile
@atotto
atotto / ssh.go
Last active May 26, 2021
golang ssh terminal client
View ssh.go
package main
import (
"context"
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
@nguyendangminh
nguyendangminh / favicon.ico.go
Last active Feb 23, 2021
Serve favicon.ico in Golang
View favicon.ico.go
...
func faviconHandler(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "relative/path/to/favicon.ico")
}
...
func main() {
http.HandleFunc("/favicon.ico", faviconHandler)
}
@nochso
nochso / readme.md
Last active Aug 29, 2015
Collab guidelines
View readme.md

Proposal for collaboration guidelines

Version control

Git as a DVCS and a central Github repository for the group is hard to argue with.

Use semantic versioning when tagging releases.

PHP

Generally use php-fig's PSRs as they currently reflect PHP best practices.

@liljenstolpe
liljenstolpe / openpgp-charter.md
Last active Aug 29, 2015
Draft OpenPGP charter
View openpgp-charter.md
@pekhee
pekhee / connection.php
Created Apr 5, 2014
Setup database connection for Eloquent outside of Laravel.
View connection.php
<?php // Namespace DB;
use Illuminate\Database\Capsule\Manager as Capsule;
class Connection {
public function __construct()
{
$this->capsule = new Capsule;
// Same as database configuration file of Laravel.
@chales
chales / cache-warmer-3.sh
Last active Jul 14, 2021
A couple of simple options to parse sitemap.xml to warm the cache or for other actions such as generating memory_profiler checks.
View cache-warmer-3.sh
# This can be added to your cron job to run right after Drupal's cron or combine them into a single command so
# that it automatically executes when the cron run completes.
wget -q http://www.example.com/sitemap.xml -O - | egrep -o "http://www\.example\.com[^<]+" | wget -q -i - -O /dev/null --wait 1
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active Apr 4, 2021
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert