Skip to content

Instantly share code, notes, and snippets.

@bus710
bus710 / zig.lua
Last active January 17, 2024 03:03
Debian + Zig + AstronNvim debugging configuration
-- Should be placed in the plugins directory.
return {
"mfussenegger/nvim-dap",
config = function()
local dap, dapui = require "dap", require "dapui"
dap.adapters.lldb = {
type = 'executable',
#!/bin/bash
set -e
VERSION=$(curl --silent https://github.com/elixir-lang/elixir/releases/latest \
| grep -oP '(?<=/v)[^">]+')
if [[ "$EUID" == 0 ]]
then echo "Please run as normal user (w/o sudo)"
exit
@bus710
bus710 / main.rs
Last active April 12, 2021 21:00
Tokio + channel + enum/match
use std::fmt;
use std::time::Duration;
use tokio::sync::mpsc;
use tokio::time::sleep;
enum Value {
VData(Data),
}
struct Data {
@bus710
bus710 / README.md
Last active July 13, 2020 11:29
Raspberry Pi 4 - beta firmware update for USB mass storage boot

Raspberry Pi 4 - firmware update for USB mass storage boot

Disclaimer

This can be harmful for your RPI4 and please try this at your own risk.
Especially, the steps introduced here broke the WiFi capability of my RPi4.

Reference

Based on:

@bus710
bus710 / README.md
Last active March 1, 2024 13:54
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:

@bus710
bus710 / Dockerfile
Last active March 18, 2020 02:36
Building Flutter-web project in docker container but without Flutter SDK
FROM cirrusci/flutter:latest-web AS build
COPY . /usr/local/flutter_frontend
WORKDIR /usr/local/flutter_frontend
RUN sudo chown -R cirrus:cirrus ./*
RUN sudo chown -R cirrus:cirrus ./.*
RUN sudo rm -f .packages
RUN flutter config --enable-web
RUN flutter pub get
RUN flutter build web
@bus710
bus710 / bleCore.dart
Last active January 3, 2023 19:38
How to use flutter_blue in general
import 'dart:async';
/* If there is an error that points about the minSdkVersion,
change the number (minSdkVersion 16) to 19 in $PROJECT_ROOT/android/app/build.gradle */
// example: https://github.com/pauldemarco/flutter_blue/tree/master/example/lib
import 'package:flutter_blue/flutter_blue.dart'; // for BLE
import 'package:flutter/material.dart';
import 'utils/enums.dart';
class BLEData {
// "00010000-0002-1000-8000-00805f9b34fb"