Skip to content

Instantly share code, notes, and snippets.

@ppoffice
ppoffice / README.md
Last active April 2, 2024 08:58
A step by step guide to upgrade webview on an old Android Emulator

Tools

  1. emulator (30.3.5) (via Android SDK)
  2. adb (30.0.5) (via Android SDK)
  3. apktool (2.5.0) and Java runtime
  4. zip (3.0)
  5. unzip (6.0)

Make sure you have JAVA_HOME and ANDROID_HOME environment variables correctly set.

//------------------------------------------------------------------------
// The SwiftUI Lab: Advanced SwiftUI Animations
// https://swiftui-lab.com/swiftui-animations-part1 (Animating Paths)
// https://swiftui-lab.com/swiftui-animations-part2 (GeometryEffect)
// https://swiftui-lab.com/swiftui-animations-part3 (AnimatableModifier)
//------------------------------------------------------------------------
import SwiftUI
struct ContentView: View {
// Authoer: The SwiftUI Lab
// Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/
import SwiftUI
struct ContentView: View {
@ObservedObject var model = MyModel()
@State private var alternate: Bool = true
let array = Array<String>(repeating: "Hello", count: 100)
// Authoer: The SwiftUI Lab
// Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/
import SwiftUI
import Combine
struct Dog: Identifiable {
let id = UUID()
let name:String
let picture: String
// Authoer: The SwiftUI Lab
// Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/
import SwiftUI
struct RefreshableScrollView<Content: View>: View {
@State private var previousScrollOffset: CGFloat = 0
@State private var scrollOffset: CGFloat = 0
@State private var frozen: Bool = false
@State private var rotation: Angle = .degrees(0)
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active June 18, 2024 13:03
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@cbednarski
cbednarski / camera.py
Last active February 17, 2024 05:54
Webcam capture for python - Pops up a preview from your webcam and snaps a picture when you press 'q'
import cv2
# Windows dependencies
# - Python 2.7.6: http://www.python.org/download/
# - OpenCV: http://opencv.org/
# - Numpy -- get numpy from here because the official builds don't support x64:
# http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
# Mac Dependencies
# - brew install python
@jesusprubio
jesusprubio / gist:4066845
Last active March 15, 2023 11:47
Kamailio.cfg with SIP over websockets support included.NOTE: For GRUU support change (line 363): modparam("registrar", "gruu_enabled", 1)
#!KAMAILIO
#
# Kamailio (OpenSER) SIP Server v4.1 - default configuration script
# - web: http://www.kamailio.org
# - git: http://sip-router.org
#
# Direct your questions about this file to: <sr-users@lists.sip-router.org>
#
# Refer to the Core CookBook at http://www.kamailio.org/wiki/
# for an explanation of possible statements, functions and parameters.