// some other code here
func init() {
once.Do(func() {
args := []string{
"host=" + os.Getenv("DB_HOST"),
"port=" + os.Getenv("DB_PORT"),
"user=" + os.Getenv("DB_USER"),
"dbname=" + os.Getenv("DB_NAME"),
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
<button class="py-4 px-1 relative border-2 border-transparent text-gray-800 rounded-full hover:text-gray-400 focus:outline-none focus:text-gray-500 transition duration-150 ease-in-out" aria-label="Cart"> | |
<svg class="h-6 w-6" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor"> | |
<path d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path> | |
</svg> | |
<span class="absolute inset-0 object-right-top -mr-6"> | |
<div class="inline-flex items-center px-1.5 py-0.5 border-2 border-white rounded-full text-xs font-semibold leading-4 bg-red-500 text-white"> | |
6 | |
</div> | |
</span> | |
</button> |
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" | |
"math/rand" | |
"time" | |
) | |
func main() { | |
// all the peeps in a map ensures no duplicates |
mutation {
insert_users(objects: { username: "codebyomar" }) {
returning {
id
username
last_seen
last_typed
}
}
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
{ | |
"type": "bulk", | |
"args": [ | |
{ | |
"args": { | |
"headers": [], | |
"insert": { | |
"columns": [ | |
"id", | |
"username", |
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 notifications | |
// Result type | |
type Result struct { | |
PushToken string | |
RoomID string | |
UserID string | |
Username 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 notifications | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
s "strings" | |
"github.com/Jeffail/gabs" |
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 rooms | |
// Room is a model representation of our room table | |
type Room struct { | |
ID float64 | |
Name string | |
RoomType string | |
} | |
// UserRoom is a model representation of our user_rooms table |
DB_HOST=
DB_PORT=
DB_USER=
DB_NAME=
DB_PASSWORD=
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 rooms | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
s "strings" | |
"github.com/Jeffail/gabs" |
NewerOlder