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 / 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)
@nmoinvaz
nmoinvaz / cursortable.js
Last active November 10, 2023 22:33
Antd Cursor Paginated Table Component
import React, { useEffect, useState } from "react";
import { Table, Button, Space, Row, Col } from "antd";
import { LeftOutlined, RightOutlined } from "@ant-design/icons";
const CursorPagination = ({ startKey, lastEvaluatedKey, onChange, size }) => {
/* Use stack to keep track of which evaluated keys have been previously seen */
const [ prevEvaluatedKeys, setPrevEvaluatedKeys ] = useState([]);
/* Keep track of the current evaluated key */
const [ currentEvaluatedKey, setCurrentEvaluatedKey ] = useState(null);
@nmoinvaz
nmoinvaz / bi_reverse.c
Last active May 5, 2021 01:55
zlib-ng bi-reverse table
#include <stdio.h>
#include <cstdlib>
#include <map>
unsigned bi_reverse(unsigned code, int len) {
/* code: the value to invert */
/* len: its bit length */
unsigned long res = 0;
do {