Skip to content

Instantly share code, notes, and snippets.

View stevehenderson's full-sized avatar

Steve Henderson stevehenderson

View GitHub Profile
@Streppel
Streppel / partial_json_to_struct.go
Last active March 6, 2022 01:47
partial JSON unmarshal to go struct
package main
import (
"encoding/json"
"fmt"
)
func main() {
var err error
myJson := []byte(`{"name": "Natan", "age": 27, "hobbies": ["programming", "inline_skatting"], "is_millionaire": false}`)
@lpillmann
lpillmann / read_parquet.py
Last active November 16, 2023 05:52
Read partitioned parquet files into pandas DataFrame from Google Cloud Storage using PyArrow
import gcsfs
import pyarrow
def read_parquet(gs_directory_path, to_pandas=True):
"""
Reads multiple (partitioned) parquet files from a GS directory
e.g. 'gs://<bucket>/<directory>' (without ending /)
"""
gs = gcsfs.GCSFileSystem()
arrow_df = pyarrow.parquet.ParquetDataset(gs_directory_path, filesystem=gs)
@PhilippHomann
PhilippHomann / app.py
Last active July 22, 2023 17:11
FastAPI file upload with streaming_form_data to parse multipart/form-data
from fastapi import FastAPI, UploadFile, HTTPException
from starlette.requests import Request
from streaming_form_data import StreamingFormDataParser
from streaming_form_data.targets import FileTarget
from tempfile import NamedTemporaryFile
import os
import shutil
@KoopaKing
KoopaKing / README.md
Last active July 26, 2022 11:35
An example presto postgresql connector for Dataproc
@nicolasdao
nicolasdao / firebase_guide.md
Last active July 2, 2023 08:06
Firebase guide. Keywords: firebase identity platform google
@tanaikech
tanaikech / submit.md
Last active March 29, 2024 09:47
Simple Script of Resumable Upload with Google Drive API for Python

Simple Script of Resumable Upload with Google Drive API for Python

This is a simple sample script for achieving the resumable upload to Google Drive using Python. In order to achieve the resumable upload, at first, it is required to retrieve the location, which is the endpoint of upload. The location is included in the response headers. After the location was retrieved, the file can be uploaded to the location URL.

In this sample, a PNG file is uploaded with the resumable upload using a single chunk.

Sample script

Before you use this, please set the variables.

@Jolg42
Jolg42 / readme.md
Created January 25, 2020 14:13
Code Signing on macOS and Windows + Apple Notarization

macOS

Steps

  • What we want is to get a Developer Id https://developer.apple.com/developer-id/ to be able to sign the binaries for distribution.
  • The company needs to get an Apple Developer Account Membership for macOS for $99/y https://developer.apple.com/programs/enroll/
  • Apple needs a A D-U-N-S® Number to register the account, the person doing the registration will need to get in touch with somebody that knows the legal part.
  • The registration could take a couple days
  • When done, a certificate can be created for signing, you'll need to sync it with Xcode.
  • Now the binary can be signed, and the signature can be verified.
@deruke
deruke / winevent-logstash.conf
Created June 29, 2017 16:25
winevent-logstash
# capture windows events over JSON
# expects to be sent by the NXLOG package
# author: Joff Thyer, 2017
input {
tcp {
port => 3515
codec => json
}
}
@mcm
mcm / HOWTO.txt
Last active June 3, 2023 23:40
Use daemonlogger + VXLAN to create "software span"
**Only really tested on Ubuntu 16.04**
Requirements:
* Two Linux systems (one to send traffic, one to receive)
* Network connectivity over UDP 4789
Sender Setup
* Install daemonlogger (sudo apt install daemonlogger)
* Save systemd service config as /etc/systemd/system/daemonlogger@.service (replace X.X.X.X with IP of receiver)
* Reload systemd (sudo systemctl daemon-reload)
@keithmorris
keithmorris / drive-format-ubuntu.md
Last active June 25, 2024 04:08
Partition, format, and mount a drive on Ubuntu