Skip to content

Instantly share code, notes, and snippets.

@echoZZJ
echoZZJ / duplicate_xcode_project_target.rb
Created April 8, 2022 10:42 — forked from Fenil15/duplicate_xcode_project_target.rb
Duplicate Xcode Project Target with Ruby
#!/usr/bin/env ruby
require 'rubygems'
require 'xcodeproj'
name = 'test_copy'
proj = Xcodeproj::Project.open('test.xcodeproj')
src_target = proj.targets.find { |item| item.to_s == 'test' }
@echoZZJ
echoZZJ / icloud-caldav.rb
Created August 31, 2020 03:50 — forked from ericboehs/icloud-caldav.rb
Interface with Apple's iCloud CalDav Calendars
require 'rexml/document'
require 'rexml/xpath'
require 'http'
require 'icalendar'
HTTP::Request::METHODS = HTTP::Request::METHODS + [:report]
module AppleCalDav
class Client
attr_accessor :username, :password
@echoZZJ
echoZZJ / yahoo-caldav.md
Created August 31, 2020 03:49 — forked from lambdabaa/yahoo-caldav.md
Yahoo! CalDAV sync

PROPFIND https://caldav.calendar.yahoo.com/

<?xml version="1.0" encoding="UTF-8" ?>

<DAV:multistatus xmlns:AI="http://apple.com/ns/ical/"
              xmlns:CS="http://calendarserver.org/ns/"
              xmlns:DAV="DAV:"
              xmlns="urn:ietf:params:xml:ns:caldav"
              xmlns:ical="http://www.w3.org/2002/12/cal/ical#">
@echoZZJ
echoZZJ / PSPDFThreadSafeMutableDictionary.m
Created October 17, 2019 10:21 — forked from steipete/PSPDFThreadSafeMutableDictionary.m
Simple implementation of a thread safe mutable dictionary. In most cases, you want NSCache instead, but it can be useful in situations where you want to manually control what is evicted from the cache in low memory situations.**Warning:** I only use this for setting/getting keys. Enumeration is not thread safe here and will still throw exception…
//
// PSPDFThreadSafeMutableDictionary.m
//
// Copyright (c) 2013 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@echoZZJ
echoZZJ / PerformanceMonitor.m
Created October 12, 2019 10:47 — forked from hite/PerformanceMonitor.m
在 runloop 里捕获 主线程卡顿,并且收集到卡顿时堆栈的信息,供下一步 fabric 来处理
//
// PerformanceMonitor.m
// SuperApp
//
// Created by qianjianeng on 15/11/12.
// Copyright © 2015年 Tencent. All rights reserved.
//
#import "PerformanceMonitor.h"
#import <mach/mach.h>
@echoZZJ
echoZZJ / test_mmap_ios.m
Created August 11, 2019 12:32 — forked from piaoger/test_mmap_ios.m
mmap on ios
// It's tested on ios 8.2 ..
// Apple document about virtual memory:
// Both OS X and iOS include a fully-integrated virtual memory system that you cannot turn off; it is always on.
// https://developer.apple.com/library/mac/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html
// Discussing mmap on ios:
// http://stackoverflow.com/questions/13425558/why-does-mmap-fail-on-ios
// http://stackoverflow.com/questions/9184773/is-there-a-practical-limit-on-the-number-of-memory-mapped-files-in-ios
#include <sys/mman.h>
@echoZZJ
echoZZJ / 20181202.md
Created July 22, 2019 08:26 — forked from liuzhida33/20181202.md
iOS 制作基于pod开发第三方framework的二次封装

iOS 制作基于pod开发第三方framework的二次封装

主要记录如何将第三方SDK的.a或framwwork集成到自己的framework中,并构建自己的pod发布到私有库所遇到的问题。

集成

  1. 打开第三方SDK找到二进制文件(以iflyMSC.framework为例)
  2. 将iflyMSC的二进制文件改成.a的后缀名,重命名为libiflyMSC.a。 如果不加lib前缀,那么在后面进行pod lib lint命令时有可能会遇到这样的错误提示: