Skip to content

Instantly share code, notes, and snippets.

View myitcv's full-sized avatar

Paul Jolly myitcv

View GitHub Profile
@myitcv
myitcv / script.txt
Created November 8, 2018 21:40
Creating submodules in a single commit
$ mkdir -p /home/gopher/scratchpad/submodulestest
$ cd /home/gopher/scratchpad/submodulestest
$ git init -q
$ git remote add origin https://github.com/go-modules-by-example-staging/submodulestest
$ go mod init github.com/go-modules-by-example-staging/submodulestest
go: creating new go.mod: module github.com/go-modules-by-example-staging/submodulestest
$ mkdir b
$ cd b
$ cat <<EOD >b.go
package b
@myitcv
myitcv / 00_script.sh
Last active November 13, 2018 16:24
godef speed comparison
bash
(
set -eux
command cd $(mktemp -d)
export GOPATH=$(mktemp -d)
export PATH=$GOPATH/bin:$PATH
git clone https://github.com/ianthehat/godef
command cd godef
git checkout f2eb530fb8dbca312f4661b985ec2ae5ba5e7b3a
go install
Hello, World!
Paul Jolly
[email protected]
https://myitcv.io
@_myitcv
* Today we will
- Learn how to say, "Hello, World!"
@myitcv
myitcv / output.txt
Created January 30, 2019 19:22
gg output
$ go test -v -run="Script/command\$" myitcv.io/cmd/gg
=== RUN TestScripts
=== RUN TestScripts/command
=== PAUSE TestScripts/command
=== CONT TestScripts/command
--- PASS: TestScripts (0.06s)
--- PASS: TestScripts/command (10.84s)
<autogenerated>:1:
WORK=$WORK
HOME=/no-home
@myitcv
myitcv / main_test.go
Created March 26, 2019 09:19
testing.Helper failure in panic case
package main
import "testing"
func Test(t *testing.T) {
blah(t, func() {})
blah2(t, func() { panic("oh dear") })
}
func blah(t *testing.T, f func()) {
@myitcv
myitcv / hello_world.py
Created January 3, 2020 19:59
Hello World Examples
class HelloWorld:
def __init__(self, name):
self.name = name.capitalize()
def sayHi(self):
print "Hello " + self.name + "!"
hello = HelloWorld("world")
hello.sayHi()