Skip to content

Instantly share code, notes, and snippets.

Setup the repo

git clone [email protected]:filipstrand/mflux.git
cd mflux && pip install -r requirements.txt

Make a run script

Name this anything, maybe flux.py. Make sure to update the two paths marked below.

MLX LM with the OpenAI Python Package

1. Install

Install MLX LM and openai:

pip install mlx-lm openai
@madroidmaq
madroidmaq / projectDependencyGraph.gradle
Created March 12, 2023 08:09
Create a dependency diagram for the current project using the syntax of plantUML, with a result that looks like the following.
task projectDependencyGraph {
doLast {
def plantuml = new File(rootProject.buildDir, 'reports/dependency-graph/project.puml')
plantuml.parentFile.mkdirs()
plantuml.delete()
plantuml << '@startuml\n'
plantuml << "!define blue #00E489\n"
plantuml << "!define origin #FF8A65\n"
plantuml << "!define green #1A73E8\n"
@Krosxx
Krosxx / flutter_aar_upload.gradle
Created March 11, 2021 10:55
Flutter module upload aar to maven
// This script is used to initialize the build in a module or plugin project.
// During this phase, the script applies the Maven plugin and configures the
// destination of the local repository.
// The local repository will contain the AAR and POM files.
void configureProject(Project project, String mavenUrl, String mavenUser, String mavenPwd, String version) {
if (!project.hasProperty("android")) {
throw new GradleException("Android property not found.")
}
if (!project.android.hasProperty("libraryVariants")) {
@bentrengrove
bentrengrove / Sample.kt
Last active February 12, 2024 12:25
Sample code demonstrating using Kotlin for type safe unit conversion
val miles = 1.kilometers.to(Distance.Mile)
val kilometers = 1.miles.to(Distance.Kilometer)
val total = 2.kilometers + 1.miles + 10.meters + 1.centimeter + 1.millimeter
Log.d("MainActivity", "Total distance is ${total.meters.amount} meters")
val totalTime = 2.hours + 2.minutes + 2.seconds + 2.milliseconds
Log.d("MainActivity", "Total time is ${totalTime.amount} ${totalTime.unit}")
@D-clock
D-clock / HanziToPinyin.java
Last active September 20, 2023 06:41
从Android4.2.2原生系统中提取出来的汉字转换成拼音的方案,同时兼容国产ROM
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@staltz
staltz / introrx.md
Last active May 9, 2025 12:50
The introduction to Reactive Programming you've been missing