Skip to content

Instantly share code, notes, and snippets.

View jeff-r-koyaltech's full-sized avatar
🔭

Jeff R jeff-r-koyaltech

🔭
View GitHub Profile
@jeff-r-koyaltech
jeff-r-koyaltech / TextFieldExt.js
Created November 4, 2023 22:29
React MUI - prevent onWheel from changing a focused input type number
import { TextField } from '@mui/material';
import { useRef } from 'react';
export default function TextFieldExt(props) {
const { type } = props;
const noStupidWheelScroll = type === 'number';
const thisTextField = useRef(null);
const noOnWheelFn = (wheelEv) => {
wheelEv.preventDefault();
};
@jeff-r-koyaltech
jeff-r-koyaltech / reproduce.js
Created September 18, 2023 16:56
Long worksheet names - excel4node
import * as excel4node from 'excel4node';
// https://stackoverflow.com/questions/48643025/sheetjs-repaired-records-worksheet-properties-from-xl-workbook-xml-part-work
const main = () => {
const myWb = new excel4node.Workbook();
const longNameWs = myWb.addWorksheet(
'This is more than thirty-one characters'
);
longNameWs.cell(1, 1).string('Just a value');
myWb.write('temp.xlsx');
@jeff-r-koyaltech
jeff-r-koyaltech / gen-firebase-rewrites.js
Last active April 18, 2024 07:10
Next.js and Firebase - dynamic / "slug" routing generation script
/* Purpose
Firebase needs certain rewrite rules in place, in order to function properly with
Next.js' static routing. This only applies to statically generated Next.js
projects (i.e. built by 'next build' 'next export')
Inspired by the discussion at:
https://github.com/firebase/firebase-js-sdk/discussions/4980
*/
@jeff-r-koyaltech
jeff-r-koyaltech / tlsChallengeCheck.sh
Last active January 27, 2022 02:13
Bash command for checking if the recent TLS-ALPN-01 affects you (Jan 26 2022)
# See this URL for more details 🚨
# https://traefik.io/blog/how-to-force-update-lets-encrypt-certificates/?utm_campaign=Let%27s%20Encrypt%20Issue&utm_medium=email&_hsmi=202062799&_hsenc=p2ANqtz-84m7OPEeg9o4xkToQefSLny16r8DkAl9NHEdv7C4z91iNvLF9rRqqKTD1DbTr-cCSGvx4QO9oNzdG0w7WHd0s-adhSoLZ4e1PsO8jcvT0WMOEPpSU&utm_content=202062799&utm_source=hs_email
# if there is no output, you are probably good to go 👍
kubectl get pod --all-namespaces -l app.kubernetes.io/name=traefik -o wide | grep traefik \
| awk '{ print $1, $2 }' | xargs -n2 bash -c 'kubectl describe -n $0 pod $1' \
| grep tlsChallenge
### Keybase proof
I hereby claim:
* I am jeff-r-koyaltech on github.
* I am kubectl_apply (https://keybase.io/kubectl_apply) on keybase.
* I have a public key ASBYqmJeWa5M4j1KqUhbWoLRxVVIlwvrOz_YQ0sRT-HOFgo
To claim this, I am signing this object:
// example:
// curl -X POST -H 'Content-Type: application/json' http://localhost:4000/stripe/customers/byCard \
// --data '{ "email": "user@host.com", "last4": "4242", "exp_month": 4, "exp_year":"22" }' | jq
const util = require('util')
let stripe_key = process.env.STRIPE_SK
let stripe = require('stripe')(stripe_key)
@jeff-r-koyaltech
jeff-r-koyaltech / Package.appxmanifest
Created August 16, 2015 15:02
Full appxmanifest for TextSecure-UWP
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Version="0.5.0.0" Name="39705SimonDieterle.TextSecure" Publisher="CN=D7D38CBF-3113-497A-88DB-52B717888A39" />
<mp:PhoneIdentity PhoneProductId="baaa3ed2-1f3a-4a86-91aa-b9c7c296e913" PhonePublisherId="043dd04d-998e-43b5-9450-82637d90e0a8" />
<Properties>
<DisplayName>TextSecure</DisplayName>
<PublisherDisplayName>Simon Dieterle</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
@jeff-r-koyaltech
jeff-r-koyaltech / Package.appxmanifest
Created August 13, 2015 08:02
How to register curve25519 in a Universal Windows app
<Package ...>
<!-- ... blah blah blah ... -->
<Extensions>
<Extension Category="windows.activatableClass.inProcessServer">
<InProcessServer>
<Path>curve25519.dll</Path>
<ActivatableClass ActivatableClassId="curve25519.Curve25519Native" ThreadingModel="both" />
</InProcessServer>
</Extension>
</Extensions>
@jeff-r-koyaltech
jeff-r-koyaltech / gist:8df783df5a0c8368d8ed
Created August 1, 2015 02:05
Troubleshooting NuGet in Visual Studio 2015 RTM
PM> Install-Package Google.ProtocolBuffers
Install-Package : Unable to find package 'Google.ProtocolBuffers'
At line:1 char:1
+ Install-Package Google.ProtocolBuffers
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
PM> Get-Package -ListAvailable