Skip to content

Instantly share code, notes, and snippets.

View Adron's full-sized avatar
🤘
GSD. Just ping me, I'll get back at ya.

Adron Hall Adron

🤘
GSD. Just ping me, I'll get back at ya.
View GitHub Profile
@Adron
Adron / main.go
Created May 20, 2019 01:01
Learning about go runes and hacking together some examples.
... the rest of the main.go file is here...
var runes []rune
for _, r := range "Language: 走" {
runes = append(runes, r)
}
fmt.Printf("%q \n", runes)
var x, y []int
@Adron
Adron / the_months.go
Last active May 20, 2019 01:02
the months
months := [...]string{1: "January", 2:"February", 3: "March", 4:"April", 12:"December"}
for _, s := range months {
fmt.Printf("The month: %s\n", s)
}
var runes []rune
for _, r := range "Language: 走" {
runes = append(runes, r)
}
@Adron
Adron / testing-out-composite-types.go
Last active May 20, 2019 01:02
Trying Out Composite Types
fmt.Println("Hello, let's talk composite types.")
basketOfStuff := [3]string{"The first string","second","This string."}
var zeeValues [2]int
for i, v := range basketOfStuff {
fmt.Printf("Value %d: %s\n", i, v)
}
fmt.Println(zeeValues)
@Adron
Adron / currency.go
Last active May 20, 2019 01:02
Creating a Currency Type
type Currency int
const (
USD Currency = iota
CAN
EUR
GBP
JPY
NOK
SEK
@Adron
Adron / main.go
Created March 10, 2019 21:00
Rendering an SVG and more maths!
package main
import (
"fmt"
"io/ioutil"
"math"
"strconv"
)
const (
@Adron
Adron / main.go
Created March 10, 2019 20:49
Lesson 3 Starting Code
package main
import (
"fmt"
"math"
"strconv"
)
func main() {
var someInt int
@Adron
Adron / main.go
Created March 1, 2019 21:34
Getting min max for various types in Go
package main
import (
"fmt"
"math"
)
const(
MinUint uint = 0 // all zeroes
// Perform a bitwise NOT to change every bit from 0 to 1.
@Adron
Adron / main.go
Created February 6, 2019 08:42
Using the Random Data Generation Library
package main
import (
"fmt"
randomdata "github.com/Pallinder/go-randomdata"
)
func main() {
// Print a random silly name
@Adron
Adron / main.go
Created February 6, 2019 07:41
Using the Temperature Package
package main
import (
"fmt"
tempconv "github.com/Adron/awesomeProject/tempconv"
)
func main() {
fmt.Println("Temperatures are hard to figure off the top of one's mind!")
@Adron
Adron / temperatureConversion.go
Created February 6, 2019 07:40
Temperature Conversion Examples
package tempconv
type Celsius float64
type Fahrenheit float64
const (
AbsoluteZeroC Celsius = -273.15
FreezingC Celsius = 0
BoilingC Celsius = 100
)