Skip to content

Instantly share code, notes, and snippets.

@leandrodaher
leandrodaher / BuildRustAppForAndroid.sh
Created March 1, 2024 14:54 — forked from pgp/BuildRustAppForAndroid.sh
Cross compile RUST application for Android (uses standalone toolchains, NDK >= 19 required)
# arm
export PATH=$PATH:$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
export CC=armv7a-linux-androideabi19-clang
export CXX=armv7a-linux-androideabi19-clang++
~/.cargo/bin/cargo build --target armv7-linux-androideabi
# aarch64
export PATH=$PATH:$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin
export CC=aarch64-linux-android21-clang
export CXX=aarch64-linux-android21-clang++
@leandrodaher
leandrodaher / README.md
Created March 1, 2024 13:54 — forked from bus710/README.md
Building rust native library to be used by flutter/android

Building rust native library to be used by flutter/android

This short doc shows how to build rust to be used by flutter/android app.
Inspired by hyousef's work but added some details for the workflow.



References

Docs:

@leandrodaher
leandrodaher / MultiDimArrayPost.class.php
Created February 27, 2024 19:57 — forked from mohsinrasool/MultiDimArrayPost.class.php
Post multi-dimensional array using PHP Curl.
/**
* Post multi-dimensional array to a URL using PHP Curl.
* Usage:
* $req = new MultiDimArrayPost();
* $req->postToURL('http://xyz.com/post',$_POST);
*
* @package default
* @author Mohsin Rasool
*
**/
@leandrodaher
leandrodaher / crud.c
Created January 24, 2024 15:03 — forked from talnetd/crud.c
Simple CRUD in C to understand how one connect to DATABASE
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#define MAX_DATA 512
#define MAX_ROWS 100
struct Address {
@leandrodaher
leandrodaher / audio-pitch-correction.md
Created January 15, 2024 13:43 — forked from 0xdevalias/audio-pitch-correction.md
Some notes on Audio pitch correction (eg. autotune, melodyne, etc)
@leandrodaher
leandrodaher / stream.js
Created December 6, 2023 19:49 — forked from DingGGu/stream.js
NodeJS Mp3 Streaming ExpressJS
var express = require('express');
var app = express();
var fs = require('fs');
app.listen(3000, function() {
console.log("[NodeJS] Application Listening on Port 3000");
});
app.get('/api/play/:key', function(req, res) {
var key = req.params.key;
@leandrodaher
leandrodaher / .block
Created November 27, 2023 11:57 — forked from mbostock/.block
Programmatic Pan+Zoom
license: gpl-3.0
redirect: https://observablehq.com/@d3/programmatic-zoom
@leandrodaher
leandrodaher / image-zoom.js
Created November 1, 2023 14:27 — forked from JamesKyburz/image-zoom.js
image-zoom.js
zoom(window.document.querySelector('img'))
function zoom (img) {
let canvas
if (img.width) {
load()
} else {
img.addEventListener('load', load)
}
@leandrodaher
leandrodaher / product.proto
Created October 19, 2023 17:14 — forked from argentinaluiz/product.proto
Protofile do desafio da Imersão Full Cycle
syntax = "proto3";
package github.com.codeedu.codepix;
option go_package = "protofiles/pb";
service ProductService {
rpc CreateProduct (CreateProductRequest) returns (CreateProductResponse) {};
rpc FindProducts(FindProductsRequest) returns (FindProductsResponse) {};
}
@leandrodaher
leandrodaher / gist:2f08c775690c0e3d31dc4b40b0d5e60f
Created October 16, 2023 13:24 — forked from johnballantyne/gist:4089627
GetMultiCellHeight() script for FPDF
function GetMultiCellHeight($w, $h, $txt, $border=null, $align='J') {
// Calculate MultiCell with automatic or explicit line breaks height
// $border is un-used, but I kept it in the parameters to keep the call
// to this function consistent with MultiCell()
$cw = &$this->CurrentFont['cw'];
if($w==0)
$w = $this->w-$this->rMargin-$this->x;
$wmax = ($w-2*$this->cMargin)*1000/$this->FontSize;
$s = str_replace("\r",'',$txt);
$nb = strlen($s);