Skip to content

Instantly share code, notes, and snippets.

View jamesholcomb's full-sized avatar

James Holcomb jamesholcomb

View GitHub Profile
@b0gdanw
b0gdanw / Disable-Ventura-Bloatware.sh
Last active October 18, 2024 02:02
Disable Ventura Bloatware
#!/bin/zsh
# Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
# Disabling unwanted services on macOS Big Sur (11), macOS Monterey (12) and macOS Ventura (13)
# Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
# Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist, disabled.501.plist
# To revert, delete /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist and reboot; sudo rm -r /private/var/db/com.apple.xpc.launchd/*
# user
@mau21mau
mau21mau / setup-loadbalancer-with-nginx-ingress-controller.md
Last active April 10, 2024 20:58
How to setup Nginx Ingress Controller and L7 HTTP(S) Load Balancer to work together on GKE

This steps assume we already have a Cluster created with VPC-native traffic routing enabled.

Before the need of the HTTP(S) LoadBalancer, I would just apply the manifests provided by the NGINX DOCS page for the installation of the Nginx Ingress Controller and It would create a service of type LoadBalancer which would, then, create a regional L4 LoadBalancer automatically.

But now that I need need to have Cloud Armor and WAF, the L4 Loadbalancer doesn't support it. A HTTP(S) Load Balancer is needed in order to Cloud Armor to work.

In order to have Nginx Ingress controller working with the new HTTPS(S) LoadBalancer we need to change the type: LoadBalancer on the Nginx Ingress Controller service to ClusterIP instead, and add the NEG annotation to it cloud.google.com/neg: '{"exposed_ports": {"80":{"name": "ingress-nginx-80-neg"}}}'. We do that because we don't want it to generate a L4 LoadBalancer for us. Instead, we will manually create an HTTP(S) LoadBalancer and bind it t

@nandorojo
nandorojo / links.tsx
Created November 29, 2021 19:34
React Native + Next.js Link Components
@vladi-strilets
vladi-strilets / FormInputController.tsx
Last active December 15, 2023 19:18
Custom reusable controller for react-hook-form and TypeScript + NativeBase
import { FormControl, Input } from 'native-base'
import React from 'react'
import {
Control,
Controller,
FieldError,
Path,
RegisterOptions,
} from 'react-hook-form'
# Warning: This config does not include keys that have an unset value
# ~/.config/starship.toml
format = '''\[$time\] $status$cmd_duration$username@$hostname \[$directory\]
[> ](bold)'''
scan_timeout = 30
command_timeout = 500
add_newline = false
[aws]
@jerome-benoit
jerome-benoit / CircularArray.md
Last active September 3, 2022 22:07
TypeScript circular array module
/**
 * Default circular array size.
 */
export const DEFAULT_CIRCULAR_ARRAY_SIZE = 2000

/** Array with a maximum length shifting items when full. */
export class CircularArray<T> extends Array<T> {
  /** @inheritdoc */
  public size: number
@mrousavy
mrousavy / useStyle.ts
Last active August 1, 2023 13:16
`useStyle` - a typed `useMemo` for styles which also includes style flattening and searching
import { DependencyList, useMemo } from "react";
import {
ImageStyle,
RegisteredStyle,
StyleProp,
StyleSheet,
TextStyle,
ViewStyle,
} from "react-native";
@benstjohn
benstjohn / jira-ticketing.js
Created December 15, 2020 17:17
This is for creating a React Native Jira Issue collector In-App! NOTE: You’ll need to import `import base64 from 'react-native-base64';
// This code sample uses the 'node-fetch' library:
// https://www.npmjs.com/package/node-fetch
const fetch = require("node-fetch");
const bodyData = `{
"update": {},
"fields": {
"summary": "Main order flow broken",
"parent": {
"key": "PROJ-123"
/**
* @typedef {Object} ClassifyProps
* @property {React.ElementType} [as] - Element to render
* @property {import('clsx').ClassValue} [className] - Composable classnames passed to clsx
*/
/**
* @param {ClassifyProps} props
*/
function Classify({ as: El = "div", ...props }) {
@desrod
desrod / build-cse-table.py
Last active November 7, 2022 13:36
Query Zwift public, upcoming events and build an HTML table of those events (in Python)
There are two parts to this:
1. The main Python code that uses requests + json to parse the events
2. The external Jinja2 template that the data is rendered by, producing the HTML output
# ----------------------------------------------------------------------------------------------------------------
#!/usr/bin/env python3
import json