Skip to content

Instantly share code, notes, and snippets.

@Rukh
Rukh / URLRequest+cURL.swift
Last active March 28, 2024 09:53 — forked from abhi21git/ExtensionURLRequest.swift
Swift cURL Printer
//
// URLRequest+cURL.swift
//
// Created by Dmitry Gulyagin on 19/02/2024.
//
import struct Foundation.URLRequest
public extension URLRequest {
@katleta3000
katleta3000 / Mobius 2019
Last active February 29, 2024 22:08
Список материалу к докладу "Работаем с сетью эффективно" Ртищев Евгения для Mobius 2019 22-23 мая
1. Очень крутая книжка по сетям (стек OSI) – Charles Severance “Introduction to Network: How the Internet works”
2. URLCache – https://nshipster.com/nsurlcache/
3. Ресёрч HTTP-кеширования с использованием URLCache https://qnoid.com/2016/04/10/A-primer-in-HTTP-caching-and-its-native-support-by-iOS.html
4. Анализ доступности сети:
* SimplePing – https://developer.apple.com/library/archive/samplecode/SimplePing/Introduction/Intro.html
* https://github.com/dustturtle/RealReachability
* https://github.com/ankitthakur/SwiftPing
* https://github.com/lmirosevic/GBPing
* https://github.com/rwbutler/Connectivity
* Баг с 2009 года – https://lists.apple.com/archives/macnetworkprog/2009/May/msg00056.html
@dvlden
dvlden / ffmpeg.md
Last active September 25, 2024 20:12
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@junpluse
junpluse / CVError.swift
Created December 15, 2016 11:21
CVReturn as Swift.Error
//
// CVError.swift
//
// Created by Jun Tanaka on 2016/12/13.
// Copyright © 2016 Jun Tanaka. All rights reserved.
//
import CoreVideo
public enum CVError: Int32, Error {
@MihaelIsaev
MihaelIsaev / CameraViewController.swift
Created April 16, 2015 19:30
This is the example of camera view for iOS written in Swift
import UIKit
import AVFoundation
class ViewController: UIViewController, AVCaptureMetadataOutputObjectsDelegate {
@IBOutlet weak var myView: UIView!
var session: AVCaptureSession?
var device: AVCaptureDevice?
var input: AVCaptureDeviceInput?
@itsrifat
itsrifat / extract_frames.cpp
Last active July 13, 2023 18:48
simple c++ functions to extract frames of a video file into a vector of Mat and saving the vector as jpg images using OpenCV 2.4.9
/*
This functions opens a video file and extracts the frames and put them into a vector of Mat(its the class for representing an img)
*/
void extract_frames(const string &videoFilePath,vector<Mat>& frames){
try{
//open the video file
VideoCapture cap(videoFilePath); // open the video file
if(!cap.isOpened()) // check if we succeeded
CV_Error(CV_StsError, "Can not open Video file");
@genedelisa
genedelisa / AudioPlayer
Last active January 20, 2017 10:16
Swift AVAudioPlayer
class Sound : NSObject {
/// The player.
var avPlayer:AVAudioPlayer!
/**
Uses AvAudioPlayer to play a sound file.
The player instance needs to be an instance variable. Otherwise it will disappear before playing.
*/
func readFileIntoAVPlayer() {
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR
@Valthoron
Valthoron / xcode-build-bump.sh
Last active December 9, 2022 10:22 — forked from sekati/xcode-build-bump.sh
Set a timestamp as the build number when an Xcode project is compiled.
# xcode-build-timestamp.sh
# @desc Set a timestamp as the build number when the project is compiled.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Target dependencies"
buildNumber=$(date +%Y%m%d%H%M)
@jtomschroeder
jtomschroeder / nslog_notimestamp.h
Created March 13, 2013 18:00
NSLog without a timestamp.
#define NSLog(FORMAT, ...) fprintf( stderr, "%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String] );