Skip to content

Instantly share code, notes, and snippets.

View oskarhertzman's full-sized avatar
⌨️
Mashing keyboard

Oskar Hertzman oskarhertzman

⌨️
Mashing keyboard
View GitHub Profile
@mac-cain13
mac-cain13 / Info.plist
Last active April 20, 2025 09:51
Function to request and check Local Network permission on iOS, iPadOS & visionOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSBonjourServices</key>
<array>
<string>_preflight_check._tcp</string>
</array>
</dict>
</plist>
@KristofferEriksson
KristofferEriksson / useShare.ts
Created February 7, 2024 22:19
A React Typescript hook that let users share your content directly via native share dialogs
import { useCallback, useEffect, useState } from "react";
// Types for the useShare hook parameters
interface UseShareParams {
onShare?: (content: ShareParams) => void;
onSuccess?: (content: ShareParams) => void;
onError?: (error: any) => void;
fallback?: () => void;
successTimeout?: number;
}
@oskarhertzman
oskarhertzman / package.json
Last active January 24, 2024 18:31
React Native scripts
"scripts": {
"start": "watchman watch-del-all && react-native start --reset-cache",
"react:link": "react-native link",
"android": "react-native run-android",
"android:shake": "adb shell input keyevent 82",
"android:clean": "cd android && ./gradlew clean && ./gradlew cleanBuildCache && cd .. ",
"android:build:store:aab": "cd android && ./gradlew bundleStoreRelease && cd ..",
"android:build:aab": "cd android && ./gradlew bundleRelease && cd ..",
"android:build:apk": "cd android && ./gradlew assembleStoreRelease && cd ..",
"android:release": "react-native run-android --variant storeRelease",
@Catherine-K-George
Catherine-K-George / AWSS3Uploader.swift
Last active December 20, 2024 11:30
File upload to AWS S3 with pre-signed URL iOS/Swift 5
import AWSS3
class AWSS3Uploader {
/// Creates a upload request for uploading the specified file to a presigned remote URL
///
/// - Parameters:
/// - fileURL: The URL of the file to upload.
/// - remoteURL: The presigned URL
/// - completion: The completion handler to call when the upload request is complete.
@gbero
gbero / fish_shell_android_home.txt
Last active May 14, 2024 06:47
Export $ANDROID_HOME on MacOS with Fish shell
touch ~/.config/fish/config.fish;
echo "set --export ANDROID $HOME/Library/Android;" >> ~/.config/fish/config.fish
echo "set --export ANDROID_HOME $ANDROID/sdk;" >> ~/.config/fish/config.fish
echo "set -gx PATH $ANDROID_HOME/tools $PATH;" >> ~/.config/fish/config.fish
echo "set -gx PATH $ANDROID_HOME/tools/bin $PATH;" >> ~/.config/fish/config.fish
echo "set -gx PATH $ANDROID_HOME/platform-tools $PATH;" >> ~/.config/fish/config.fish
echo "set -gx PATH $ANDROID_HOME/emulator $PATH" >> ~/.config/fish/config.fish
echo "set --export JAVA_HOME /Applications/Android\ Studio.app/Contents/jbr/Contents/Home;" >> ~/.config/fish/config.fish
@danielestevez
danielestevez / gist:2044589
Last active April 13, 2025 23:35
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}