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
# General | |
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
export PATH=$PATH:$HOME/bin | |
# git | |
alias gd="git diff" | |
alias gs='git status' | |
alias gp='git push' | |
alias latest_tag='git tag | sort -V | tail -n1' |
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" | |
"io" | |
"net/http" | |
) | |
func main() { | |
response, err := http.Get("https://example.com") |
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" | |
func fac(n int) int { | |
ret := 1 | |
for i := n; i > 1; i-- { | |
ret *= i | |
} | |
return ret |
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" | |
"sort" | |
) | |
type AgeFactor []Person | |
func (a AgeFactor) Len() int { return len(a) } |
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" | |
"regexp" | |
"strings" | |
) | |
func reverseString(s string) string { | |
runes := []rune(s) |
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" | |
"sort" | |
) | |
// Implementation of sum of three ints. Do any three ints | |
// in the given slice sum up to the target? | |
// Interate through eacn int. For each iteration set low and |
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" | |
"sort" | |
) | |
// Implementation of sum of two ints. Do any two ints | |
// in the given slice sum up to the target? Leverages | |
// sorting O(n logn) and two pointers. If the sum of the |
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" | |
// A recursive palindrome function. The terminal cases | |
// are: | |
// A. when a string is less than or equal to 1 (a 1 length string is by | |
// definition a palindrome). | |
// B. when the first and last characters of a string don't match, we know | |
// the whole string is not a palindrome. |
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 | |
func isPalindrome(inputString string) bool { | |
// Initialize two pointers, one at the beginning of the string, | |
// the second at the end. | |
// Traverse the string from each direction and check if each | |
// pair is identical. | |
// If not return False. If we reach the middle return true. | |
leftIndx := 0 | |
rightIndx := len(inputString) - 1 |
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" | |
func main() { | |
nums := make([]int, 100) | |
for n := range nums { | |
o := n + 1 | |
if o%15 == 0 { | |
fmt.Println("fizz buzz") |
NewerOlder