Skip to content

Instantly share code, notes, and snippets.

@jampajeen
jampajeen / git-pushing-multiple.rst
Created February 20, 2021 13:13 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@gangsta
gangsta / SSL.md
Last active February 23, 2024 03:56
How to Setting Up a Comodo SSL Cert

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

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

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
@Tusko
Tusko / jquery.ajax.js
Last active November 12, 2021 02:54
$.ajax Promise
/*
* ajax Defaults (optional):
$.ajaxSetup({
type : 'POST',
dataType : 'json',
cache : true,
global : true,
data : {},
contentType : 'application/json',
beforeSend : function (xhr) {
@yanmhlv
yanmhlv / example.go
Created February 8, 2016 14:49
JSONB in gorm
package main
import (
"database/sql/driver"
"encoding/json"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
)
@elliotchance
elliotchance / server.go
Last active May 30, 2020 18:40
A simple server in Go
package main
import (
"bufio"
"fmt"
"net"
)
func check(err error, message string) {
if err != nil {
@tevino
tevino / epoll.go
Last active January 20, 2024 22:50
An example of using epoll in Go
package main
import (
"fmt"
"net"
"os"
"syscall"
)
const (
@hongster
hongster / tcp_timeout.go
Created October 2, 2015 11:30
Golang example on handling TCP connection and setting timeout.
package main
import (
"fmt"
"net"
"time"
"bufio"
)
func handleConnection(conn net.Conn) {
@patrickmn
patrickmn / observer.go
Created January 2, 2012 09:12
Go observer pattern example
package main
import (
"fmt"
"sync"
"time"
)
var wg *sync.WaitGroup