Skip to content

Instantly share code, notes, and snippets.

View xeecos's full-sized avatar

xeecos xeecos

View GitHub Profile
@xeecos
xeecos / test.cc
Created April 21, 2025 09:03
test wasm
#include <emscripten/bind.h>
#include <emscripten/val.h>
val print_test(const char* infile, const char* outfile)
{
val ret = val::object();
//processing
ret.set("res", 0);
return ret;
}
@xeecos
xeecos / init.gradle.kts
Created October 28, 2024 04:33
全局替换gradle下载源,放到~/.gradle/下
/**
* Description: Set up mirrors for Gradle Globally
*/
val MAVEN_REPOSITORY_URL = "https://mirrors.cloud.tencent.com/nexus/repository/maven-public"
val CENTER_REPOSITORY_URL = "https://maven.aliyun.com/repository/jcenter"
val GOOGLE_REPOSITORY_URL = "https://maven.aliyun.com/repository/google"
val GRADLE_PLUGIN_REPOSITORY_URL = "https://maven.aliyun.com/repository/gradle-plugin"
gradle.settingsEvaluated {
pluginManagement {
@xeecos
xeecos / main.dart
Created August 21, 2024 07:56
flutter tab bar and push pop page example
import 'package:flutter/material.dart';
import 'pages.dart';
void main() {
runApp(const CPMain());
}
// ignore: must_be_immutable
class CPMain extends StatefulWidget {
const CPMain({super.key});
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
void str_printf(char *str, const char *fmt, ...);
int main()
{
char *str = (cahr*)malloc(256);
str_printf(str, "p:%.3f %d\n", 1.23, 1234);
printf(str);
@xeecos
xeecos / grid.svg
Created May 30, 2024 00:59
grid for litmus paper
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@xeecos
xeecos / rendersvg.js
Last active October 10, 2023 02:53
render svg using nanosvg.js
import {parse as parseSVG} from "./nanosvg.js"
let svg = fs.readFileSync(svg_url).toString();
let res = parseSVG(svg,"mm",72);
let canvas = document.getElementById("canvas");
let ctx = canvas.getContext("2d");
for (let shape = shapes; shape != null; shape = shape.next) {
if(shape.fill.type==1)
{
let color = shape.fill.color;
let r = Number(color&0xff);
@xeecos
xeecos / main.cpp
Last active March 8, 2023 08:55
jpeg encode test @https://github.com/espressif/esp-adf-libs/tree/master/esp_codec
#include <Arduino.h>
#include "esp_jpeg_enc.h"
int esp_jpeg_enc_demo1()
{
/// configure encoder
jpeg_enc_info_t info = DEFAULT_JPEG_ENC_CONFIG();
info.quality = 80;
info.src_type = JPEG_RAW_TYPE_RGB888;
/// allocate input buffer to fill original image stream.
@xeecos
xeecos / lz4.sh
Created February 22, 2023 08:42
ubuntu 18.04 install lz4
sudo apt-get install liblz4-tool
@xeecos
xeecos / esp32-s3-wroom-1.json
Created February 7, 2023 01:03
platformio add esp32-s3-wroom-1 board
{
"build": {
"arduino":{
"ldscript": "esp32s3_out.ld",
"partitions": "default_8MB.csv",
"memory_type": "qio_opi"
},
"core": "esp32",
"extra_flags": [
"-DARDUINO_ESP32S3_DEV",
@xeecos
xeecos / potrace.js
Created January 31, 2023 02:34
add stroke support
'use strict';
var Jimp = require('jimp');
var Bitmap = require('./types/Bitmap');
var Curve = require('./types/Curve');
var Point = require('./types/Point');
var Path = require('./types/Path');
var Quad = require('./types/Quad');
var Sum = require('./types/Sum');
var Opti = require('./types/Opti');