Skip to content

Instantly share code, notes, and snippets.

View yamin8000's full-sized avatar
💭
I may be slow to respond.

Yamin Siahmargooei yamin8000

💭
I may be slow to respond.
View GitHub Profile
@yamin8000
yamin8000 / LetterSpacedPersianText.kt
Created March 29, 2023 02:41
Jetpack Compose Letter Spaced Persian Text
@Composable
fun LetterSpacedPersianText(
text: String,
modifier: Modifier = Modifier,
color: Color = Color.Unspecified,
fontSize: TextUnit = 14.sp,
fontStyle: FontStyle? = null,
fontWeight: FontWeight? = null,
fontFamily: FontFamily? = null,
letterSpacing: TextUnit = TextUnit.Unspecified,
@yamin8000
yamin8000 / copyright-profile
Last active March 29, 2023 02:38
Android Studio GPLv3 Copyright Profile
@yamin8000
yamin8000 / !CsvFromListMain.kt
Last active August 15, 2022 06:51
Create CSV from a Kotlin List
fun main() {
val firstCategory = Category(0, "Phone")
val secondCategory = Category(1, "Laptop")
val categories = listOf(firstCategory, secondCategory)
val csv = csvOf(
listOf("id", "name"),
categories
) {
listOf(it.id.toString(), it.name)
}
@yamin8000
yamin8000 / OkHttpLambdaAsyncCallback.kt
Created June 30, 2021 18:15
OkHttp/Retrofit async call with lambda callback
package com.github.yamin8000.fare.model
import android.os.Bundle
import com.github.yamin8000.fare.databinding.ActivityMainBinding
import com.github.yamin8000.fare.ui.BaseActivity
import com.github.yamin8000.fare.web.Services
import com.github.yamin8000.fare.web.WEB
class MainActivity : BaseActivity() {
@usametov
usametov / topics-search.txt
Created February 16, 2021 01:50
how to search github.com for multiple topics
Github.com ui .currently does not natively supoport search for multiple topic tags as of now. However their api allows you to query multiple tags. Below is a simple example to query github.com with ecs and go topic tags.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories?q=topic:ecs+topic:go
Response from the github can be rather verbose so lets filter only relavant info such repo url and description.
curl -H "Accept: application/vnd.github.mercy-preview+json" \
https://api.github.com/search/repositories\?q\=topic:ecs+topic:go | jq '.items[] | {url:.url, description:.description}'

Demo:

Spoiler warning

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

console.log("I'm a code block!");
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active April 25, 2024 17:19
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 30, 2024 23:36
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName