This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
//FindGCD - finds the greatest common divisor between two numbers | |
func FindGCD(a, b int) (gcd int) { | |
var list []int | |
for i := 1; i <= smallestNumber(a, b); i++ { | |
if a%i == 0 && b%i == 0 { | |
list = append(list, i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//topological sort | |
package main | |
import ( | |
"fmt" | |
"sort" | |
) | |
var pathOfFullstack = map[string][]string{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type cat string | |
//String from type cat always meows | |
func (c cat) String() string { | |
return fmt.Sprintln("A Cat always Meows") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type cat string | |
//String from type cat always meows | |
func (c cat) String() string { | |
return fmt.Sprintf("A Cat always Meows") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package circle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package circle | |
import "github.com/err/square" | |
//CircleShape is the typealias for square.Shape | |
type CircleShape = square.Shape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package authentication | |
//config.go has all the configuration constants | |
//The following has the slack constants | |
const ( | |
slackClientID = "6XXXXXXXXXXXXXXXXOOOOOOOOOOOOOOO" | |
slackClientSecret = "xxxxxxxxxxxxa2ffexxxxxxxxxxxxxxx" | |
slackAuthURL = "https://slack.com/oauth/authorize" | |
slackTokenURL = "https://slack.com/api/oauth.access" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package authentication | |
//SlackAuth responses back the Login URL | |
func (LoginService) SlackAuth(ctx context.Context) (redirectURL string, err error) { | |
conf := &oauth2.Config{ | |
ClientID: slackClientID, | |
ClientSecret: slackClientSecret, | |
Scopes: slackScopes, | |
Endpoint: oauth2.Endpoint{ | |
AuthURL: slackAuthURL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"redirectURL": "https://slack.com/oauth/authorize?access_type=offline&client_id=6xxxvvv.28976558208&response_type=code&scope=identity.basic&state=state", | |
"error": "" | |
} |
OlderNewer