Skip to content

Instantly share code, notes, and snippets.

@nathanborror
nathanborror / gcloud-run.md
Last active May 31, 2022 15:50
How to setup a new Go project using Google Cloud Run and Cloud SQL.

Go Google Cloud

How to setup a new Go project using Google Cloud Run and Cloud SQL.

Setup a new project

Update gcloud and authenticate

$ gcloud components update
$ gcloud auth login
@j-bullard
j-bullard / App.tsx
Created July 4, 2021 07:15
Headless UI with React Hook Forms
import "./styles.css";
import { Person } from "./types";
import { Listbox } from "./listbox/listbox";
import { useForm } from "react-hook-form";
const people: Person[] = [
{ id: 1, name: "Durward Reynolds", unavailable: false },
{ id: 2, name: "Kenton Towne", unavailable: false },
{ id: 3, name: "Therese Wunsch", unavailable: false },
{ id: 4, name: "Benedict Kessler", unavailable: true },
@bojand
bojand / index.md
Last active March 1, 2024 19:32
gRPC and Load Balancing

Just documenting docs, articles, and discussion related to gRPC and load balancing.

https://github.com/grpc/grpc/blob/master/doc/load-balancing.md

Seems gRPC prefers thin client-side load balancing where a client gets a list of connected clients and a load balancing policy from a "load balancer" and then performs client-side load balancing based on the information. However, this could be useful for traditional load banaling approaches in clound deployments.

https://groups.google.com/forum/#!topic/grpc-io/8s7UHY_Q1po

gRPC "works" in AWS. That is, you can run gRPC services on EC2 nodes and have them connect to other nodes, and everything is fine. If you are using AWS for easy access to hardware then all is fine. What doesn't work is ELB (aka CLB), and ALBs. Neither of these support HTTP/2 (h2c) in a way that gRPC needs.

# coding: utf-8
import logging
import re
from collections import Counter
import numpy as np
import torch
from sklearn.datasets import fetch_20newsgroups
from torch.autograd import Variable
@whizzzkid
whizzzkid / XPS-15 9560 Getting Nvidia To Work on KDE Neon
Last active December 3, 2022 15:43
[XPS 15 Early 2017 9560 kabylake] Making Nvidia Drivers + (CUDA 8 / CUDA 9 / CUDA 9.1) + Bumblebee work together on linux ( Ubuntu / KDE Neon / Linux Mint / debian )
# Instructions for 4.14 and cuda 9.1
# If upgrading from 4.13 and cuda 9.0
$ sudo apt-get purge --auto-remove libcud*
$ sudo apt-get purge --auto-remove cuda*
$ sudo apt-get purge --auto-remove nvidia*
# also remove the container directory direcotory at /usr/local/cuda-9.0/
# Important libs required with 4.14.x with Cuda 9.X
$ sudo apt install libelf1 libelf-dev
@njam
njam / arch-linux
Last active July 13, 2023 06:54
Install Arch Linux on XPS 13 9360
# Installation on Dell XPS
# Please also consult official documentation:
# https://wiki.archlinux.org/index.php/Installation_Guide
# https://wiki.archlinux.org/index.php/Dell_XPS_13_(9360)
# https://wiki.archlinux.org/index.php/Dell_XPS_15_(9550)
# Enter BIOS with F2 and configure:
# - "System Configuration" > "SATA Operation": "AHCI"
# - "Secure Boot" > "Secure Boot Enable": "Disabled"
@m0nocle
m0nocle / Makefile
Created December 4, 2011 14:53
Go Websocket example
run: clean example
./example
include $(GOROOT)/src/Make.inc
TARG=example
GOFILES=\
main.go\
include $(GOROOT)/src/Make.cmd