Skip to content

Instantly share code, notes, and snippets.

View rampadc's full-sized avatar

Cong Nguyen rampadc

View GitHub Profile
@rampadc
rampadc / add-owners-shared-outlook-calendar.md
Created October 24, 2023 03:09
Add owners to shared outlook calendar

You will need a Windows machine with the Microsoft Outlook app installed to look up the mailbox's location.

  1. Start Powershell, doesn't have to be admin mode.
  2. Install the Exchange Online Powershell module: https://learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps#install-and-maintain-the-exchange-online-powershell-module
  3. Import the module: Import-Module ExchangeOnlineManagement
  4. Login and connect: Connect-ExchangeOnline -UserPrincipalName <UPN>. The <UPN> is your e-mail address. This will open the browser to authenticate you.
  5. Get the shared calendar or mailbox path. This can be found in the calendar's Properties panel, in "General > Location" tab in the Outlook desktop app. For example, let's say it is \\user@domain.com\Calendar, and the calendar's name is Calendar name.
  6. Get existing users' permissions: Get-MailboxFolderPermission -Identity user@domain.com:"\Calendar\Calendar name". Reference: https://learn.microsoft.com/en-us/powershell/m
@rampadc
rampadc / createSampleBufferFromPixelBuffer.swift
Created February 21, 2021 09:24
Create a CMSampleBuffer from CVPixelBuffer
// Usage
let pixelBuffer: CVImageBuffer? = createPixelBufferFrom(image: image) // see https://gist.github.com/rampadc/10a7dc257552f1fb86c1fcc2d1671bd9
let sampleBuffer: CMSampleBuffer? = createSampleBufferFrom(pixelBuffer: pixelBuffer)
// Function
func createSampleBufferFrom(pixelBuffer: CVPixelBuffer) -> CMSampleBuffer? {
var sampleBuffer: CMSampleBuffer?
var timimgInfo = CMSampleTimingInfo()
var formatDescription: CMFormatDescription? = nil
@rampadc
rampadc / createPixelBufferFromCIImage.swift
Created February 21, 2021 09:22
Create a CVPixelBuffer from a CIImage
// Usage - CVImageBuffer and CVPixelBuffer are the same types
let pixelBuffer: CVImageBuffer? = createPixelBufferFrom(image: image)
// How CIContext was declared - used in a MTKView class
device = MTLCreateSystemDefaultDevice()
framebufferOnly = false
colorPixelFormat = .bgra8Unorm
commandQueue = device!.makeCommandQueue()
Config.shared.ciContext = CIContext(mtlDevice: self.device!)
@rampadc
rampadc / macOS_bonded_auto_reconnect
Created July 29, 2020 14:55
esp32_mouse_keyboard: macOS bonded, subsequent powerups
I (2826) HID_LE_PRF: HID connection establish, conn_id = 0
I (2836) HID_DEMO: ESP_HIDD_EVENT_BLE_CONNECT
I (2836) HID_LE_PRF: GATT EVT 4
I (2846) HID_DEMO: remote BD_ADDR: 8c85908a6d15
I (2846) HID_DEMO: address type = 0
I (2856) HID_DEMO: pair status = success
I (2906) HID_LE_PRF: GATT EVT 1
@rampadc
rampadc / macOS_bonded_successful_1
Created July 29, 2020 14:43
esp32_mouse_keyboard: successfully bonded on Catalina 10.15.6
I (2456) EXT_UART: external UART processing task started
I (2466) HID_LE_PRF: GATT EVT 12
D (13446) BT_SMP: SMDBG l2c smp_connect_callback
I (13446) HID_LE_PRF: HID connection establish, conn_id = 0
I (13446) HID_DEMO: ESP_HIDD_EVENT_BLE_CONNECT
I (13446) HID_LE_PRF: GATT EVT 4
D (13456) BT_SMP: SMP_Pair state=0 br_state=0 flag=0x0
D (13456) BT_SMP: SMDBG l2c smp_connect_callback
@rampadc
rampadc / c_cpp_properties.json
Last active June 14, 2020 11:49
Win32 ESP32 c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${env:IDF_PATH}/components/**",
"${env:ADF_PATH}/components/**"
],
"browse": {
@rampadc
rampadc / c_cpp_properties.json
Last active June 14, 2020 11:49
Mac ESP32 .vscode/c_cpp_properties.json
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"${env:IDF_PATH}/components/**",
"${env:ADF_PATH}/components/**"
],
"browse": {
@rampadc
rampadc / .nx_aliases
Created November 10, 2019 04:19
Aliases for Nx CLI to use with NestJS
alias nx-g:module='ng g @nestjs/schematics:module --sourceRoot=apps/api/src --path=app'
alias nx-g:service='ng g @nestjs/schematics:service --sourceRoot=apps/api/src --path=app'
alias nx-g:controller='ng g @nestjs/schematics:controller --sourceRoot=apps/api/src --path=app'
alias nx-g:gateway='ng g @nestjs/schematics:gateway --sourceRoot=apps/api/src --path=app'
@rampadc
rampadc / tw2-list-of-tutorials.js
Created September 23, 2019 15:14
tw2-list-of-tutorials.js
define("conf/tracking", [], function() {
var a = {};
return a.TUTORIAL = {
NAMES: {
0: {
name: "tutorial_start_next_step",
step: 0
},
1: {
name: "open_hq_screen_select_headquarter",
@rampadc
rampadc / tw2-messages-enter-new-world.json
Last active September 23, 2019 15:14
tw2-messages-enter-new-world.json
Choosing a new world sequence
{"type":"World/getForPlayer","data":{},"id":37}
{"id":37,"type":"World/forPlayer","data":{"worlds":[{"id":"en44","name":"Rupea","full":false,"recommended":0,"key_required":false},{"id":"en46","name":"Tzschocha","full":false,"recommended":0,"key_required":false},{"id":"en47","name":"Uhrovec","full":false,"recommended":1,"key_required":false}],"characters":[{"character_id":1133170,"character_name":"Simp1eUs3rname","world_id":"en45","world_name":"Stargard","maintenance":false,"allow_login":true,"character_owner_id":1133170,"character_owner_name":"Simp1eUs3rname","key_required":false,"is_banned":false}]}}
{"type":"Authentication/leaveWorld","data":{},"id":38}
{"type":"Authentication/createCharacter","data":{"world":"en47"},"id":3}
{"id":3,"type":"Authentication/characterCreated","data":{"id":1133170,"world_id":"en47"}}
{"type":"Character/createVillage","data":{"name":"Simp1eUs3rname's ville","direction":"northwest"},"id":15}