Skip to content

Instantly share code, notes, and snippets.

View LivioGama's full-sized avatar

Livio Gamassia LivioGama

View GitHub Profile
package plugins
import (
"context"
"encoding/json"
"fmt"
"os"
"strconv"
sqlite_vec "github.com/asg017/sqlite-vec-go-bindings/cgo"
@marnixk
marnixk / pocketbase_stripe_utils.js
Created July 18, 2024 10:15
Pocketbase Stripe Javascript Functions
/*
____ _ _ _ _ _ _ _
/ ___|| |_ _ __(_)_ __ ___ | | | | |_(_) |___
\___ \| __| '__| | '_ \ / _ \ | | | | __| | / __|
___) | |_| | | | |_) | __/ | |_| | |_| | \__ \
|____/ \__|_| |_| .__/ \___| \___/ \__|_|_|___/
|_|
Purpose:
@acominotto
acominotto / iap.md
Created May 22, 2024 08:01
Set up with

How to validate payments for ios / android in the backend with react native iap and expo.

Set up react-native-iap

in your project :

npm install react-native-iap

then add react-native-iap to your plugins in app.config.(js|ts) or app.json

import copy
import json
import os
from openai import OpenAI
client = OpenAI(
api_key="<Your api key here>"
)
@statico
statico / useModals.tsx
Created December 19, 2021 18:26
Chakra UI await-able alert, confirm, and prompt modal dialogs
/*
* Usage:
* const { alert, confirm, prompt } = useModals()
* alert("Hey!") // awaitable too
* if (await confirm("Are you sure?")) ...
* const result = await prompt("Enter a URL", "http://")
*/
import React, {
createContext,
@gorgos
gorgos / MultiSwap.sol
Created August 22, 2021 11:04
Example for how to swap multiple tokens in one on Ropsten
// SPDX-License-Identifier: MIT
pragma solidity =0.7.6;
pragma abicoder v2;
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/ISwapRouter.sol";
import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/IQuoter.sol";
import {IERC20, SafeERC20} from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4-solc-0.7/contracts/token/ERC20/SafeERC20.sol";
interface IUniswapRouter is ISwapRouter {
@saniales
saniales / A-Transferwise-Slack-Integration-with-Cloudflare-Workers.md
Last active September 28, 2024 05:40
A TransferWise integration with Slack Webhooks using Cloudflare Workers

TransferWise webhook integration with Slack notifications using Cloudflare Workers

Greetings from the Tryvium Team,

Here is how to integrate a Transferwise webhook with Slack notifications. We have chosen to use cloudflare workers as a perfect case study for serverless applications using cloudflare.

Setting things up

@Ribesg
Ribesg / !README.md
Last active June 20, 2022 15:00
How to use a Kotlin MPP library depending on an iOS Framework in a XCode iOS App

This gist demonstrates how to use a Kotlin MPP library which depends on an iOS Framework in a native iOS application (XCode project).

First, see [how the Kotlin MPP Library is built][lib-build].

Key ideas:

  • We can currently only use a single Kotlin MPP library in an iOS project, so we need to create a MPP project local to our iOS XCode project whose sole purpose is to aggregate multiple MPP dependencies into a single Framework.
  • To keep our working environment clean, we create the gradle project in a subdirectory instead of at the root of our iOS XCode project. I name my subdirectory mpp.
  • We need to have the Frameworks used by our dependencies locally, as we only have bindings provided by the cinterop klibs, so we use [Carthage] again.
  • As the only goal of our gradle project is to create a Framework, we only use ios* targets.
  • Our project won't have any source code, but we NEED at least one source file, or Gradle will refuse to build anything, returning just a rude NO-SOURCE. Just create
@jogboms
jogboms / Fastfile
Created August 10, 2018 08:17 — forked from rodydavis/Fastfile
Top-level Fastfile for Flutter
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
@lsavino
lsavino / compilation-optimization.md
Last active July 27, 2022 17:44
Compiler Optimizations, Compiling Optimally, and Whole Modules

DEPRECATED for Xcode 10 🎈

(check out What's New in Swift at 11:40, slide 42)

Whole Module Compilation Optimizations: Why these terms are sometimes misleading

When you look up how to compile swift faster for debug builds, people very earnestly give advice that seems contradictory: you should "try using the whole module optimization flag," and also "never use whole module optimization for debugging". [^1]

This is confusing because some of us are using these two general words:

compilation: "turning text into an executable program"