Skip to content

Instantly share code, notes, and snippets.

@timezstyle
timezstyle / Golang program stdin stdout interaction.md
Created November 28, 2017 06:22 — forked from jamesrr39/Golang program stdin stdout interaction.md
Using stdout and stdin from other programs in Golang

Go program interaction

Example of how to use stdout and stdin from other programs in golang

Requires go

Run

go run parentprocess.go
@timezstyle
timezstyle / private-fork.md
Created May 10, 2017 03:25 — forked from DavideMontersino/private-fork.md
How to fork to a private gitlab instance

Theory:

your git repository can have more than one remote server; In this case we want to have two:

  1. one for our private repository on gitlab (will be the default one, called origin)
  2. one to be connected to the source repo on github, to be able to pull new changes (will be called upstream)

How to make a private fork from github to gitlab

@timezstyle
timezstyle / request_handler_test.py
Created July 28, 2016 23:40 — forked from didip/request_handler_test.py
Testing Tornado RequestHandlers
import unittest, os, os.path, sys, urllib
import tornado.database
import tornado.options
from tornado.options import options
from tornado.testing import AsyncHTTPTestCase
# add application root to sys.path
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(APP_ROOT, '..'))
@timezstyle
timezstyle / mock.go
Created February 18, 2016 04:02 — forked from imosquera/gist:6716490
golang mock
package main
// Restorer holds a function that can be used
// to restore some previous state.
type Restorer func()
// Restore restores some previous state.
func (r Restorer) Restore() {
r()
}
@timezstyle
timezstyle / sendMail.go
Created November 1, 2015 05:11 — forked from andelf/sendMail.go
golang send mail net/smtp SMTP
package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"