Skip to content

Instantly share code, notes, and snippets.

View adigunhammedolalekan's full-sized avatar
🎯
Working Remotely

Hammed Adigun adigunhammedolalekan

🎯
Working Remotely
View GitHub Profile
import "github.com/docker/docker/pkg/archive"
// createBuildContext archive a dir and return an io.Reader
func createBuildContext(path string) (io.Reader, error) {
return archive.Tar(path, archive.Uncompressed)
}
class SignUpRequest {
String firstName;
String lastName;
String pin;
List<Identifier> identifiers;
}
class Identifier {
String identifier;
String identifierType;
func createBuildContext() (io.Reader, error) {
// get current working dir
wd, err := os.Getwd()
if err != nil {
return nil, err
}
// resolve Dockerfile path
path := filepath.join(wd, "Dockerfile")
return os.Open(path)
}
events {
worker_connections 1024;
}
http {
server_tokens off;
server {
listen 80;
location /api/account {
@adigunhammedolalekan
adigunhammedolalekan / RoomExample.java
Created February 17, 2019 18:21
Room, LiveData example
// this file is just a pseudo code of the whole idea
// we have 3 entities - Booking, User and Address(Origin and Destination)
// example userDao
class UserDao {
public User getUser(int id);
}
package utils
import (
"encoding/json"
"net/http"
)
func Message(status bool, message string) (map[string]interface{}) {
return map[string]interface{} {"status" : status, "message" : message}
}
package controllers
import (
"net/http"
"go-contacts/models"
"encoding/json"
u "go-contacts/utils"
"strconv"
"github.com/gorilla/mux"
"fmt"
package models
import (
u "go-contacts/utils"
"github.com/jinzhu/gorm"
"fmt"
)
type Contact struct {
gorm.Model
package controllers
import (
"net/http"
u "go-contacts/utils"
"go-contacts/models"
"encoding/json"
)
var CreateAccount = func(w http.ResponseWriter, r *http.Request) {
package models
import (
"github.com/dgrijalva/jwt-go"
u "lens/utils"
"strings"
"github.com/jinzhu/gorm"
"os"
"golang.org/x/crypto/bcrypt"
)