Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"github.com/jaypipes/ghw"
)
func main() {
fmt.Println("MEMORY")
package main
import (
"errors"
"testing"
)
func coreFunc(t int) error {
return nil
}
#!/bin/bash
# Bold
BBlack='\033[1;30m' # Black
BRed='\033[1;31m' # Red
BGreen='\033[1;32m' # Green
BYellow='\033[1;33m' # Yellow
BBlue='\033[1;34m' # Blue
BPurple='\033[1;35m' # Purple
BCyan='\033[1;36m' # Cyan
// Functional Options Pattern
package main
import (
"fmt"
)
func main() {
ct := NewCompany(
WitICO("11"),
package main
import (
"bufio"
"bytes"
"fmt"
"log"
"net/http"
"os/exec"
"strings"
@podanypepa
podanypepa / main.go
Last active February 27, 2021 17:52
package main
import (
"context"
"fmt"
"log"
"time"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
set exrc
set relativenumber
set nu
set nohlsearch
set hidden
set noerrorbells
set nowrap
set smartcase
set tabstop=5 softtabstop=4
set shiftwidth=4
package main
import (
"fmt"
"net"
"regexp"
"strings"
)
var emailRegex = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
@podanypepa
podanypepa / main.go
Last active August 31, 2020 09:56
Enums in Golang
package main
import (
"fmt"
)
type COLOR int32
const (
BLACK COLOR = iota
function fizzBuzz() {
let a = "";
let x, y;
for (let i = 1; i <= 100; i++) {
x = i % 3;
y = i % 5;
if (x && y) {
a += i + " ";
continue;
} else {