Skip to content

Instantly share code, notes, and snippets.

View timelery's full-sized avatar

Codimation timelery

View GitHub Profile
// middleware.js
exports.filesUpload = function(req, res, next) {
// See https://cloud.google.com/functions/docs/writing/http#multipart_data
const busboy = new Busboy({
headers: req.headers,
limits: {
// Cloud functions impose this restriction anyway
fileSize: 10 * 1024 * 1024,
}
@timelery
timelery / polyline.swift
Created December 20, 2022 15:02 — forked from DejanEnspyra/polyline.swift
Polyline Google Maps iOS SDK
func drawRectange(){
/* create the path */
let path = GMSMutablePath()
path.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.0))
path.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.0))
path.add(CLLocationCoordinate2D(latitude: 37.45, longitude: -122.2))
path.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.2))
path.add(CLLocationCoordinate2D(latitude: 37.36, longitude: -122.0))
/* show what you have drawn */
{"computer":{"general":{"id":33,"name":"Computer 2","network_adapter_type":"","mac_address":"C8:2A:14:0C:43:24","alt_network_adapter_type":"","alt_mac_address":"E0:F8:47:08:39:A6","ip_address":"98.240.177.152","last_reported_ip":"192.168.1.219","serial_number":"CA40DA6C60A3","udid":"CA40DA58-60A3-11E4-90B8-12DF261F2C7E","jamf_version":"9.6.29507.c","platform":"Mac","barcode_1":"","barcode_2":"","asset_tag":"modme","remote_management":{"managed":false,"management_username":"","management_password_sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"supervised":false,"mdm_capable":false,"mdm_capable_users":{},"report_date":"2020-03-16 17:04:32","report_date_epoch":1584378272764,"report_date_utc":"2020-03-16T17:04:32.764+0000","last_contact_time":"2014-10-30 02:50:55","last_contact_time_epoch":1414637455939,"last_contact_time_utc":"2014-10-30T02:50:55.939+0000","initial_entry_date":"2014-08-19","initial_entry_date_epoch":1408479491599,"initial_entry_date_utc":"2014-08-19T20:18:11.599+0000
@timelery
timelery / assignVcenterTagsWithSingleVapiClient.js
Created May 24, 2018 21:17 — forked from trisharia/assignVcenterTagsWithSingleVapiClient.js
Assign vCenter tags via VAPI using a single VAPI client to minimize session creation
// VMware vRealize Orchestrator action sample
//
// Assign vCenter tags via VAPI using a single VAPI client to minimize session creation.
// Always creates nonexistent tags, and optionally creates nonexistent tag categories.
//
// For vRO/VAPI 7.0+
//
// Action Inputs:
// endpoint - VAPIEndpoint - VAPI Endpoint
// vm - VC:VirtualMachine - Virtual machine