Skip to content

Instantly share code, notes, and snippets.

View marcoslopes's full-sized avatar

Marcos Antonio Lopes marcoslopes

  • Brisbane, Australia
  • 23:31 (UTC +10:00)
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="https://raw.githubusercontent.com/knsv/mermaid/master/dist/mermaid.full.js"></script>
<link rel="stylesheet" href="seq.css"/>
<script>
var mermaid_config = {
startOnLoad:true
@marcoslopes
marcoslopes / appsyncDirectives.graphql
Created June 23, 2025 13:28 — forked from revmischa/appsyncDirectives.graphql
AWS AppSync GraphQL scalars and directives
# AWS AppSync GQL directives
#
## Scalars come from here:
# https://raw.githubusercontent.com/aws-amplify/amplify-cli/master/packages/amplify-graphql-types-generator/awsAppSyncDirectives.graphql
# https://docs.aws.amazon.com/appsync/latest/devguide/scalars.html
#
## Directives came from a GitHub issue here:
# https://github.com/apollographql/eslint-plugin-graphql/issues/263
## And comparing with the JSON output of
# https://docs.aws.amazon.com/appsync/latest/APIReference/API_GetIntrospectionSchema.html
@marcoslopes
marcoslopes / How to convert *app to *ipa
Created March 26, 2025 00:28 — forked from bananita/How to convert *app to *ipa
How to convert *app to *ipa
1. Create a folder called Payload
2. Place the .app folder inside of that
3. Zip up the Payload folder using normal compression
4. Then rename the file with a .ipa extension
@marcoslopes
marcoslopes / hoge.rb
Created March 1, 2024 06:09 — forked from minamijoyo/hoge.rb
Using GitHubPrivateRepositoryReleaseDownloadStrategy removed in brew v2
require "formula"
require_relative "lib/private_strategy"
class Hoge < Formula
homepage "https://github.com/yourcompany/hoge"
url "https://github.com/yourcompany/hoge/releases/download/v0.1.0/hoge_v0.1.0_darwin_amd64.tar.gz", :using => GitHubPrivateRepositoryReleaseDownloadStrategy
sha256 "6de411ff3e4b1658a413dd6181fcXXXXXXXXXXXXXXXXXXXX"
head "https://github.com/yourcompany/hoge.git"
version "0.1.0"
@marcoslopes
marcoslopes / scar_tissue.md
Created May 28, 2023 01:24 — forked from gtallen1187/scar_tissue.md
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation

@marcoslopes
marcoslopes / riscv.md
Created March 1, 2023 23:40 — forked from cb372/riscv.md
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@marcoslopes
marcoslopes / string-conversion.rs
Created January 10, 2022 23:08 — forked from jimmychu0807/string-conversion.rs
Conversion between String, str, Vec<u8>, Vec<char> in Rust
use std::str;
fn main() {
// -- FROM: vec of chars --
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}'];
// to String
let string1: String = src1.iter().collect::<String>();
// to str
let str1: &str = &src1.iter().collect::<String>();
// to vec of byte
@marcoslopes
marcoslopes / README.md
Created August 2, 2021 12:33 — forked from goliatone/README.md
Postgres TRIGGER to call NOTIFY with a JSON payload

This TRIGGER function calls PosgreSQL's NOTIFY command with a JSON payload. You can listen for these calls and then send the JSON payload to a message queue (like AMQP/RabbitMQ) or trigger other actions.

Create the trigger with notify_trigger.sql.

When declaring the trigger, supply the column names you want the JSON payload to contain as arguments to the function (see create_triggers.sql)

The payload returns a JSON object:

@marcoslopes
marcoslopes / patchprocess.md
Created January 10, 2020 05:22 — forked from emmanueltissera/patchprocess.md
Git - Applying patches to a different branch

Applying Patches to a different branch

Creating the patch

git format-patch -1 HEAD

OR

git format-patch -1 <SHA>

Applying the patch: