Skip to content

Instantly share code, notes, and snippets.

View danielpassos's full-sized avatar

Daniel Passos danielpassos

View GitHub Profile
@ardakazanci
ardakazanci / CircularMenuGroup.kt
Created April 10, 2024 07:33
Circular Menu Group with Jetpack Compose
@Composable
fun CircularMenuGroup(
icons: List<ImageVector>,
baseRadius: Float,
modifier: Modifier = Modifier,
backgroundColor: Color = Color(0xFF21FA90),
shadowElevation: Dp = 4.dp
) {
var selectedIndex by remember { mutableIntStateOf(-1) }
var sizeSliderValue by remember { mutableFloatStateOf(1f) }
@zachshallbetter
zachshallbetter / README.md
Created September 29, 2023 21:33
Middleware Examples

Next.js Middleware Examples

This Gist contains a collection of Next.js Middleware examples that demonstrate various use cases and scenarios for enhancing your Next.js applications. Middleware in Next.js allows you to intercept, modify, and control the flow of requests and responses, making it a powerful tool for building robust web applications.

Middleware Examples

  1. Authentication Middleware (authenticationMiddleware.ts):
    • Checks if the user is authenticated based on a session cookie.
    • Redirects unauthenticated users to the login page.
  • Ensures users have the necessary role to access protected routes.
@mrmanc
mrmanc / disable-macos-man-page-shortcuts.md
Last active July 28, 2024 14:32
Turn off annoying macOS man page shortcuts via the command line

Turn off annoying macOS man page shortcuts via the command line

Context

macOS 10.14.4 introduced a keyboard shortcut that conflicts with one of IntelliJ IDEA’s best shortcuts. cmd-shift-a pops open a Terminal window running an apropos search on the text selection, rather than the command palette.

You can manually disable these keyboard shortcuts via System Preferences, but this script does this programmatically. I was unable to find any existing information about how to do this via the command line, so I rolled my own solution.

It took a long time to work out which defaults domain to find the plist for this. I probably worked out the pbs domain from this post.

@huuphuoc1396
huuphuoc1396 / jacoco.gradle
Last active May 4, 2022 18:53
Compiling with language version 1.5 breaks JaCoCo: "Unexpected SMAP line: *S KotlinDebug"
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':jacocoFullReport'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$3(ExecuteActionsTaskExecuter.java:186)
Caused by: : Error while creating report
at org.jacoco.ant.ReportTask.execute(ReportTask.java:502)
Caused by: java.io.IOException: Error while analyzing PersonalRequestHelper.class.
at org.jacoco.core.analysis.Analyzer.analyzerError(Analyzer.java:162)
Caused by: java.lang.IllegalStateException: Unexpected SMAP line: *S KotlinDebug
at org.jacoco.core.internal.analysis.filter.KotlinInlineFilter.getFirstGeneratedLineNumber(KotlinInlineFilter.java:98)
@plentz
plentz / air_quality.md
Last active November 26, 2023 22:15
air quality

I’ve been obsessing interested in air quality for the last 2 months (pretty much because I saw that famous DHH talk and the Awair Element gamify it - but I highly recommend it to check if the changes you’re making are actually working). Here are a few things to consider:

  • I recommend getting a ultrasonic one just because the maintenance is just way easier. And your should REALLY think about maintenance (you don't want a filter you need to change filters every month and have a hard time cleaning it). The ones I recommend are:
    • Levoit ultrasonic 300S: huge 6L tank, good for bedrooms and smaller rooms, super easy to fill and clean. Works with Alexa and Google.
  • Levoit ultrasonic LV600S: huge 6L tank, generates a lot of umidity, ideal for bigger rooms, dece
@MarsMSJ
MarsMSJ / WebM_to_ProRes.md
Last active September 10, 2024 10:50
Convert your WebM (VP9) files to ProRes

Convert your WebM to ProRes

Like many of you lucky enough to purchase a PS5, I have been enjoying my time with the new console. One feature I started playing with is the video game capture feature via the "Create" button. I have been capturing my favorite clips here and there and selected the best ones to include a video I want to share. Unfortunately, I ran into trouble. None of my video editing applications (FCPX, DaVinci) support the WebM container. My favorite clips were all captured using WebM.

If you like me have all your favorite clips stuck in WebM then I have a solution for you. FFmpeg! This free software includes a ProRes encoder that simple enough to use works on Davinci Resolve (free version available) and Adobe Premiere! (FCPX of course supports ProRes.) See links below.

MacOS (and Linux)

On the MacOS, you can use the following command (Bash) to convert all WebM files in the current directory to ProRes.

@paolocarrasco
paolocarrasco / README.md
Last active November 5, 2024 20:08
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

# This tells kubecfg to read its config from the local directory
export KUBECONFIG=./kubeconfig
# Looking at the cluster
kubectl get nodes
kubectl get pods --namespace=kube-system
# Running a single pod
kubectl run --generator=run-pod/v1 --image=gcr.io/kuar-demo/kuard-amd64:1 kuard
kubectl get pods
Ensure Docker >=v1.10.3 is installed
Ensure fhc is installed from this branch
​npm i -g git://github.com/feedhenry/fh-fhc.git#workshop
Ensure 'oc' is installed
(Linux) curl -O http://192.168.1.247:8080/oc-linux.tar.gz
(Mac) curl -O http://192.168.1.247:8080/oc-mac.tar.gz
Clone these public repos into the same folder (preferably ~/work/)
feedhenry/fh-core-openshift-templates#master
feedhenry/fh-mbaas-openshift-templates#master
feedhenry/fh-cup#master
@nobitagit
nobitagit / iterm2.md
Last active July 30, 2024 01:01
iterm2 cheatsheet

This gist has been moved to its own Github repo, so it's easier to contribute with additions and corrections. Please open a PR there if you see any mistake, I don't track comments on here as there's no notification system for gists AFAIK. Thanks.

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number