Skip to content

Instantly share code, notes, and snippets.

View flyfire's full-sized avatar
🎯
Focusing

flyfire flyfire

🎯
Focusing
View GitHub Profile
@valekar
valekar / build.gradle
Created December 8, 2019 19:35
Build Gradle : All the AndroidX versions different from the compile
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
@wertgit
wertgit / CustomSwipeToRefresh.kt
Created November 22, 2019 03:27
A Customed SwipeRefreshLayout that handles swiping issues with a RecyclerView inside a SwipeRefreshLayout. It also works for HorizontalScrollView.
import android.annotation.SuppressLint
import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.ViewConfiguration
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import kotlin.math.abs
/**
cd ~/Library/Android/sdk/platform-tools/
# Get the hash of the mitmproxy-ca certificate.
openssl x509 -inform PEM -subject_hash_old -in ~/.mitmproxy/mitmproxy-ca.pem | head -1
# We will use this hash value, append '.0' (dot zero) and use this as the filename for the resulting Android certificate
cat ~/.mitmproxy/mitmproxy-ca.pem > c8750f0d.0
openssl x509 -inform PEM -text -in ~/.mitmproxy/mitmproxy-ca.pem -out /dev/null >> c8750f0d.0
# In an other terminal, we will start the emulator with writable /system volume
@cj1128
cj1128 / simple-tcp-server.c
Last active May 21, 2022 10:53
A simple tcp server written in C
#include <stdio.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <sys/socket.h>
#define PORT 8080
#define SA struct sockaddr
int main()
{
int sockfd, connfd, len;
@hutusi
hutusi / git paging.md
Last active January 1, 2024 15:56
Git checkout next / prev commit

Treat git log as a book, exec git next or git prev to checkout the next or the previous commit.

Please check hutusi/git-paging for updates.

@GenevieveBuckley
GenevieveBuckley / QImageViewer.py
Created June 13, 2019 07:13 — forked from acbetter/QImageViewer.py
Image Viewer Example by PyQt5 and Python 3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QImage, QPixmap, QPalette, QPainter
from PyQt5.QtPrintSupport import QPrintDialog, QPrinter
from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QMessageBox, QMainWindow, QMenu, QAction, \
qApp, QFileDialog
@shawnlinboy
shawnlinboy / BlankItemDecoration.kt
Last active December 23, 2023 03:13
An ItemDecoration implementation which provides functionality that add extra blank space between list items.
/*
* Copyright (C) 2019 Shen Lin
*
* 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
# modified from https://github.com/logcat-org/logcat.tmLanguage/blob/master/logcat-threadtime.YAML-tmLanguage
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Logcat (Android Studio)
scopeName: source.logcat.android-studio
fileTypes: [log, logcat]
uuid: 4577654e-75a2-4892-981a-793e6132f289
firstLineMatch: -* beginning of /dev/log/.*
@alexjlockwood
alexjlockwood / RingOfCirclesView.kt
Last active January 10, 2024 14:07
Kotlin implementation of a Ring of Circles animation, inspired by https://twitter.com/InfinityLoopGIF/status/1101584983259533312
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.View
private const val N = 16
private const val PERIOD1 = -10000.0
private const val PERIOD2 = -500.0
@sdhzdmzzl
sdhzdmzzl / bj-unicom-iptv.m3u
Last active April 6, 2025 15:27
北京联通iptv列表
#EXTINF:-1,CCTV-1
rtp://239.3.1.1:8000
#EXTINF:-1,CCTV-2
rtp://239.3.1.2:8004
#EXTINF:-1,CCTV-4
rtp://239.3.1.4:8216
#EXTINF:-1,CCTV-7