Skip to content

Instantly share code, notes, and snippets.

View azide0x37's full-sized avatar
🚉
Travelling

Alexander Templeton azide0x37

🚉
Travelling
View GitHub Profile
@shinyquagsire23
shinyquagsire23 / lg_switch_inputs.py
Last active February 11, 2024 14:21
LG DDC/CI control via python hidapi
import struct
import time
import hid
import sys
import argparse
#
# Constants
#
@arabold
arabold / useDataStoreQuery.tsx
Last active February 23, 2023 18:07
Simplify querying the Amplify DataStore using React hooks
import {
DataStore,
PersistentModel,
PersistentModelConstructor,
ProducerModelPredicate,
SortPredicate,
ProducerPaginationInput
} from '@aws-amplify/datastore'
import { useCallback, useEffect, useState } from 'react'
@dhanush
dhanush / build_image.go
Last active March 21, 2020 06:14
Go file to build a docker image
func BuildImage(dockerBuildCtxDir, tagName string) error {
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(300)*time.Second)
defer cancel()
dockerFileTarReader, err := tarDirectory(dockerBuildCtxDir)
//this above method will create a tar file from the directory passed in. The return has to be of type io.Reader
if err != nil {
log.Printf("Error in taring the docker root folder - %s", err.Error())
return err
}
buildArgs := make(map[string]*string)