Skip to content

Instantly share code, notes, and snippets.

View recursivecodes's full-sized avatar
💯
Living the dream

Todd Sharp recursivecodes

💯
Living the dream
View GitHub Profile
$ ffmpeg \
-f avfoundation \
-video_size 1920x1080 \
-framerate 30 \
-i "2:2" \
-c:v libx264 \
-b:v 6000K \
-maxrate 6000K \
-pix_fmt yuv420p \
-r 30 \
@recursivecodes
recursivecodes / invoke-response.json
Created March 30, 2022 19:13
invoke-response.json
[
{
"LAST_NAME": "Sharp",
"FIRST_NAME": "Todd",
"ID": "CE51F8AEFBD6C772E0539914000A4500"
},
{
"LAST_NAME": "Sharp",
"FIRST_NAME": "Rhonda",
"ID": "CE51F8AEFBD7C772E0539914000A4500"
@recursivecodes
recursivecodes / create-fn-response.json
Last active April 1, 2022 17:10
create-fn-response.json
{
"data": {
"application-id": "ocid1.fnapp.oc1.phx...",
"compartment-id": "ocid1.compartment.oc1...",
"config": {},
"defined-tags": {
"Oracle-Tags": {
"CreatedBy": "[redacted]",
"CreatedOn": "2022-03-29T17:10:35.939Z"
}
@recursivecodes
recursivecodes / build.gradle
Created March 30, 2022 19:13
build.gradle
graalvmNative {
binaries.configureEach {
buildArgs.addAll(
"-H:+StaticExecutableWithDynamicLibC",
"-Dfn.handler=atp.auto.wallet.fn.Function::handleRequest",
"--initialize-at-build-time=atp.auto.wallet.fn"
)
}
}
@recursivecodes
recursivecodes / build.gradle
Created March 30, 2022 19:13
build.gradle
version = "0.2"
@recursivecodes
recursivecodes / create-fn.sh
Created March 30, 2022 19:13
create-fn.sh
$ oci fn function create \
--application-id=ocid1.fnapp.oc1.phx... \
--display-name=atp-auto-wallet-fn \
--memory-in-mbs=2048 \
--image=phx.ocir.io/toddrsharp/atp-auto-wallet/atp-auto-wallet-fn:0.1
@recursivecodes
recursivecodes / FunctionTest.java
Created March 30, 2022 19:13
FunctionTest.java
public class FunctionTest {
@Test
public void testFunction() {
FnTestingRule rule = FnTestingRule.createDefault();
rule.givenEvent().enqueue();
rule.thenRun(Function.class, "handleRequest");
String result = rule.getOnlyResult().getBodyAsString();
assertNotNull(result);
}
}
@recursivecodes
recursivecodes / build-push.sh
Created March 30, 2022 19:13
build-push.sh
$ ./gradlew dockerBuild
$ ./gradlew dockerPush
$ oci fn function invoke \
--function-id=ocid1.fnfunc.oc1.phx... \
--body="" \
--file -
@recursivecodes
recursivecodes / run-test.sh
Created March 30, 2022 19:13
run-test.sh
$ ./gradlew test