Skip to content

Instantly share code, notes, and snippets.

View MaTriXy's full-sized avatar

Yossi Elkrief MaTriXy

View GitHub Profile
<?
//
// AUTO KEYWORD-BASED FOLLOWER CURATION BOT (by @levelsio)
//
// File: twitterFollowerCuratorBot.php
//
// Created: May 2021
// License: MIT
//
@MaTriXy
MaTriXy / collect_code.sh
Created September 24, 2024 13:40 — forked from sullyo/collect_code.sh
Clones a github repo and puts all the code into a single text file perfect for LLMs
#!/bin/bash
# Check if a GitHub URL is provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <github_url>"
exit 1
fi
# Store the GitHub URL
GIT_URL="$1"
@MaTriXy
MaTriXy / README.md
Created September 12, 2024 15:28 — forked from sayakpaul/README.md
This code snippet shows how to split the Flux transformer across two 16GB GPUs and run inference with the full pipeline.
@MaTriXy
MaTriXy / l3min.py
Created August 9, 2024 16:17 — forked from awni/l3min.py
"""
A minimal, fast example generating text with Llama 3.1 in MLX.
To run, install the requirements:
pip install -U mlx transformers fire
Then generate text with:
python l3min.py "How tall is K2?"
@MaTriXy
MaTriXy / ClippedForeground.kt
Created June 15, 2023 11:16 — forked from KlassenKonstantin/ClippedForeground.kt
evervault.com inspired animation
import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.nativeCanvas
@Composable
@MaTriXy
MaTriXy / ParallaxScreen.kt
Created May 27, 2022 07:46 — forked from surajsau/ParallaxScreen.kt
Parallax effect with Jetpack Compose
@Composable
fun ParallaxScreen(modifier: Modifier = Modifier) {
val context = LocalContext.current
val scope = rememberCoroutineScope()
var data by remember { mutableStateOf<SensorData?>(null) }
DisposableEffect(Unit) {
val dataManager = SensorDataManager(context)
dataManager.init()
@MaTriXy
MaTriXy / CGRect+Center.swift
Created November 4, 2020 09:54 — forked from cotkjaer/CGRect+Center.swift
Swift extensions to add "center" to CGRect
extension CGRect
{
/** Creates a rectangle with the given center and dimensions
- parameter center: The center of the new rectangle
- parameter size: The dimensions of the new rectangle
*/
init(center: CGPoint, size: CGSize)
{
self.init(x: center.x - size.width / 2, y: center.y - size.height / 2, width: size.width, height: size.height)
@MaTriXy
MaTriXy / DynamicMeshNetwork.kt
Created October 7, 2020 08:03 — forked from ditn/DynamicMeshNetwork.kt
Dynamic Mesh Network animation in Compose
private val PARTICLE_COLOR = Color.White
private val LINE_COLOR = Color.White
private const val PARTICLE_QUANTITY = 100
private const val DEFAULT_SPEED = 2
private const val VARIANT_SPEED = 1
private const val DEFAULT_RADIUS = 4
private const val VARIANT_RADIUS = 2
private const val LINK_RADIUS = 200
// TODO: 30/09/2020 These should be measured but are only used to calculate
// the initial position
@MaTriXy
MaTriXy / CircularProgressIndicator.kt
Created September 18, 2020 04:08 — forked from alexjlockwood/CircularProgressIndicator.kt
Example implementation of a CircularProgressIndicator using Jetpack Compose https://twitter.com/alexjlockwood/status/1300599202448199681
package com.alexjlockwood.circularprogressindicator
import android.os.Bundle
import android.view.animation.PathInterpolator
import androidx.appcompat.app.AppCompatActivity
import androidx.compose.animation.core.*
import androidx.compose.animation.transition
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
@MaTriXy
MaTriXy / Completion.swift
Created August 4, 2020 15:24 — forked from preble/Completion.swift
A cancellable completion for Swift.
final class Completion<R> {
private let closure: (R) -> Void
private var cancelled = false
/// `closure` is called upon completion, if not cancelled.
init(closure: (R) -> Void) {
self.closure = closure
}