Skip to content

Instantly share code, notes, and snippets.

View nmoinvaz's full-sized avatar

Nathan Moinvaziri nmoinvaz

  • Phoenix, United States
View GitHub Profile
@nmoinvaz
nmoinvaz / useEnhancedQuery.js
Last active January 3, 2025 21:04
useQuery with Enhanced Error Handling
import {useCallback, useEffect, useMemo, useState} from "react";
import {useQuery} from "react-query";
// Provide ability to reset the error
const useEnhancedQuery = (queryKey, queryFn, options) => {
const {error: queryError, refetch: queryRefetch, status, ...queryResult} =
useQuery(queryKey, queryFn, options);
const [error, setError] = useState(queryError);
@nmoinvaz
nmoinvaz / cef-symbols-sentry.yaml
Last active May 3, 2024 21:34
Upload CEF symbols to Sentry.io
# CEF symbols are too large to upload directly to Sentry.io. The maximum size is 2GB.
# We use Breakpad to reduce the size of the original symbols at the expense of some
# fidelity for inline functions.
name: CEF Symbols
on:
workflow_dispatch:
inputs:
cef-version:
description: 'Version of CEF to upload'
required: true
@nmoinvaz
nmoinvaz / notary.py
Created December 23, 2022 01:24
Apple Notarization Submission Script
#!/usr/bin/env python
import argparse
import boto3
import jwt
import requests
import time
import os
import hashlib
from datetime import timezone
from datetime import datetime
@nmoinvaz
nmoinvaz / notary_bug.md
Created October 18, 2022 21:42
Notary API SHA256 bug
@nmoinvaz
nmoinvaz / clang-format.ps1
Last active June 6, 2022 22:34
PowerShell Clang-Format all files
$files=(git ls-files --exclude-standard); foreach ($file in $files) { if ((get-item $file).Extension -in ".cpp", ".hpp", ".c", ".cc", ".cxx", ".h", ".hxx", ".ixx", ".hh", ".m", ".mm") { &clang-format -i -style=file $file } }
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <arm_neon.h>
#include <byteswap.h>
#include <stdio.h>
#include <stdint.h>
```
2022-01-19T20:11:24-08:00
Running C:\Users\nathan\Source\zlib-ng\build\test\benchmarks\Release\benchmark_zlib.exe
Run on (8 X 2995 MHz CPU s)
CPU Caches:
L1 Data 48 KiB (x4)
L1 Instruction 32 KiB (x4)
L2 Unified 1280 KiB (x4)
L3 Unified 12288 KiB (x1)
--------------------------------------------------------------------
@nmoinvaz
nmoinvaz / adler32_benchmark.cc
Last active December 1, 2021 18:55
adler32_benchmark_pr_1053
/*
cmake_minimum_required(VERSION 3.17)
cmake_policy(SET CMP0091 NEW)
project(adler32_benchmark CXX)
set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
add_executable(adler32_benchmark)
add_subdirectory(benchmark)
target_sources(adler32_benchmark PRIVATE adler32_benchmark.cc)
@nmoinvaz
nmoinvaz / crc32_benchmark.cc
Last active July 7, 2021 04:23
crc32_benchmark.cc
/*
cmake_minimum_required(VERSION 3.17)
cmake_policy(SET CMP0091 NEW)
include(FetchContent)
project(crc32_benchmark CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED YES)