Skip to content

Instantly share code, notes, and snippets.

@hardiksachan
hardiksachan / README.md
Last active February 10, 2025 18:38
Jetpack Compose Expandable Search Bar (Top Bar)

Sample

@TheMelody
TheMelody / Compose - CustomWebView.kt
Last active April 8, 2025 08:19
Jetpack Compose - WebView 使用方法
@Composable
fun CustomWebView(modifier: Modifier = Modifier,
url:String,
onBack: (webView:WebView?) -> Unit,
onProgressChange: (progress:Int)->Unit = {},
initSettings: (webSettings:WebSettings?) -> Unit = {},
onReceivedError: (error: WebResourceError?) -> Unit = {}){
val webViewChromeClient = object:WebChromeClient(){
override fun onProgressChanged(view: WebView?, newProgress: Int) {
//回调网页内容加载进度
@meyerlasse
meyerlasse / BarChartIconRenderer.kt
Last active June 20, 2021 09:03
Renderer class capable of drawing little icons as X-axis labels in MPAndroidChart BarCharts (v3.1.0), based on https://stackoverflow.com/a/45143200/3617426
package com.meyer.lasse.helper.mpandroidchart
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import com.github.mikephil.charting.animation.ChartAnimator
import com.github.mikephil.charting.interfaces.dataprovider.BarDataProvider
import com.github.mikephil.charting.renderer.BarChartRenderer
import com.github.mikephil.charting.utils.Utils
import com.github.mikephil.charting.utils.ViewPortHandler
@larsneo
larsneo / viewer.html
Last active May 21, 2025 17:22 — forked from jsprpalm/viewer.html
Pinch zoom implementation for PDF.js viewer
<!-- Goes into viewer.html just before ending </body> -->
<script>
let pinchZoomEnabled = false;
function enablePinchZoom(pdfViewer) {
let startX = 0, startY = 0;
let initialPinchDistance = 0;
let pinchScale = 1;
const viewer = document.getElementById("viewer");
const container = document.getElementById("viewerContainer");
const reset = () => { startX = startY = initialPinchDistance = 0; pinchScale = 1; };
@islishude
islishude / k8s-install.md
Last active August 21, 2025 08:24
k8s-国内源安装

MOVE TO HERE

注意以下命令,需要切换到 root 后运行

安装 docker

首先确定已经安装完成 docker,如果没有安装可以使用以下脚本快速安装并配置:

@rambolee
rambolee / aqicn_json_data_analysis.md
Last active November 26, 2023 02:32
aqicn.org 接口 json 分析
@noelboss
noelboss / git-deployment.md
Last active August 12, 2025 18:16
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@samuelsh
samuelsh / generic_multiprocess_dir_crawler.py
Last active November 17, 2022 06:53
Generic multiprocessing directory tree walker and file crawler.Directory tree walker and file scanner processes are running in parallel which make it pretty fast.It uses python multiprocessing.
#!/usr/bin/python
import multiprocessing
import os
import subprocess
import os.path
import sys
from Queue import Empty
from multiprocessing import Process, Pool
from optparse import OptionParser
import traceback
@evantoli
evantoli / GitConfigHttpProxy.md
Last active October 6, 2025 10:42
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@JeffJacobson
JeffJacobson / FileSystemExtensions.cs
Created February 23, 2012 18:35
C# extension method for walking the file system.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace FileSystemHelper
{
public static class FileSystemExtensions
{