Skip to content

Instantly share code, notes, and snippets.

@ahmed2m
ahmed2m / dispatch.py
Last active December 7, 2022 23:19 — forked from ciiqr/dispatch.sh
github actions, repository_dispatch with client_payload
import requests
user="user"
repo="repo"
token="token"
url = f"https://api.github.com/repos/{user}/{repo}/dispatches"
payload = {"event_type": "awesomeness", "client_payload": {"foo": "bar"}}
header = {"Accept": "application/vnd.github.everest-preview+json", "Authorization": f"token {token}"}
resp = requests.post(url=url, headers=header, json=payload)
@ahmed2m
ahmed2m / react-native-file-upload.js
Created June 18, 2020 22:04 — forked from nandorojo/react-native-file-upload.js
Upload a file to your server using react native / expo.
/*
IF YOU WANT TO UPLOAD ONE FILE, USE THE CODE BELOW.
SEE THE BOTTOM OF THE GIST TO SEE HOW TO UPLOAD MULTIPLE FILES.
HERE'S AN EXAMPLE SOMEONE MADE USING CLOUDINARY: https://gist.github.com/jamielob/5c1a5dc84e50e4507b71299d993dffec
*/