Skip to content

Instantly share code, notes, and snippets.

@zbeekman
zbeekman / GH-CF-strict-SSL-w-CDN.md
Last active May 14, 2024 16:11
Setting up GH-pages with custom domain, strict (end-to-end) SSL with CloudFlare DNS & CDN

Custom domains, GH-pages, Cloudflare and strict SSL end-to-end encryption

Why I wrote this

Before Github supported SSL encryption for github pages sites, many people were using CloudFlare (CF) as their DNS provider and CDN proxy. CF allowed users to enable SSL encryption from the CDN end points/proxies to the end user. This was great and it allowed visitors to your website to connect with a secure connection between their browser and the cloudflare CDN box that was serving your content. However, with this setup one (significant) link in the chain remained unencrypted and

@IanColdwater
IanColdwater / twittermute.txt
Last active May 23, 2024 18:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@Dominaezzz
Dominaezzz / AnimatedGif.kt
Last active March 22, 2024 02:45
Rendering GIF animation with compose
import androidx.compose.animation.core.*
import androidx.compose.desktop.Window
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
@hazycora
hazycora / youtube-subscription-csv-export.md
Last active May 31, 2024 18:50
Export YouTube subscriptions in CSV Google Takeout format.

Go to youtube.com/feed/channels

The page should display a list of your YouTube subscriptions. Run the following JavaScript in the console. Your YouTube subscriptions will be displayed on screen for you to copy-paste.

This CSV response can be saved and imported into other apps which can load Google Takeout subscription files, such as NewPipe.

@Josuhu
Josuhu / GoogleBilling
Created December 16, 2022 07:18
Google Billing and In app purchases
import android.app.Activity
import android.content.Context
import android.util.Log
import androidx.compose.runtime.mutableStateOf
import com.android.billingclient.api.*
import com.android.billingclient.api.Purchase
import com.holdtorun.serverdog.application.dataStore
import com.holdtorun.serverdog.secrets.BillingId
import com.holdtorun.serverdog.tools.MyLogging
import com.holdtorun.serverdog.tools.MyToasts
@halilozercan
halilozercan / DrawGlyphs.kt
Created October 1, 2023 20:30
A Set of helper functions and classes to draw each individual glyph separately
import androidx.compose.ui.draw.drawWithCache
import androidx.compose.ui.geometry.CornerRadius
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.ImageBitmap
@michalguspiel
michalguspiel / SwiftUIComponent.swift
Created March 15, 2024 11:59
Swift UI in Compose Multiplatform
class TheFactory: Factory {
func makeController() -> UIViewController {
MySwiftUIViewController()
}
}
// Create your SwiftUI view
struct MySwiftUIView: View {
var body: some View {
Text("Hello, SwiftUI!")
@KlassenKonstantin
KlassenKonstantin / Pull2Refresh.kt
Created March 26, 2024 11:23
Fitbit style Pull 2 Refresh
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
P2RTheme {
// A surface container using the 'background' color from the theme
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
CompositionLocalProvider(
LocalOverscrollConfiguration provides null // Disable overscroll otherwise it consumes the drag before we get the chance
//settings.gradle.kts
dependencyResolutionManagement {
repositories {
maven { url = uri("https://androidx.dev/snapshots/builds/11670047/artifacts/repository/") }
google()
mavenCentral()
maven(url = "https://plugins.gradle.org/m2/")
maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
@KlassenKonstantin
KlassenKonstantin / SharedTrans.kt
Last active May 24, 2024 21:32
Popup shared transition test
private val products = listOf(
Product("🍎", "Apples"),
Product("🍪", "Cookies"),
Product("🍉", "Watermelon"),
Product("🫐", "Blueberries"),
Product("🍊", "Oranges"),
Product("🍑", "Peaches"),
Product("🥦", "Broccoli"),
)