Skip to content

Instantly share code, notes, and snippets.

@mayoff
mayoff / !README.md
Last active August 14, 2023 15:09
Debugging Objective-C blocks in lldb

The attached lldb command pblock command lets you peek inside an Objective-C block. It tries to tell you where to find the source code for the block, and the values captured by the block when it was created.

Consider this example program:

#import <Foundation/Foundation.h>

@interface Foo: NSObject
@end

@implementation Foo

@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active May 9, 2025 09:50
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

  1. 月薪是否全部通过银行工资单发放?还是部分通过第三方转账、第三方积分、发票报销的方式发放?
  2. 一年发几薪?多余 12 个月的部分一年分几次发放(影响税)?如当年未工作满 12 个月多余部分是否按工作月数等比例发放?
  3. 试用期多久,试用期工资是否有打折?
  4. 如果有股权、期权的话离职时公司是否保证会回购?
  5. 五险一金是否全额缴纳?
  6. 是否有补充公积金、补充医疗保险?
  7. 一年除了固定的基本薪资外是否有年终奖,年终奖是否有范围?
  8. 一周工作几天?一天的工作时间是几点到几点,弹性工作时间的话大家一般的工作时间是几点到几点?
  9. 是否支持长期或短期的在家办公?
  10. 是否有工作设备补贴、餐补、停车费补贴、住房补贴?补贴是否有限制条件?(比如住处距离小于多少公里才给房补贴,凑发票才给补贴)
@acrookston
acrookston / README.md
Last active January 26, 2022 11:05
Xcode pre-action to build custom Info.plist

Automatic build versions from git in Xcode (and other goodies)

Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.

1. Xcode Scheme pre-action

Edit Xcode Scheme and add a pre-action script. Copy the contents of preaction.sh into the pre-action script box.

@bishboria
bishboria / springer-free-maths-books.md
Last active March 24, 2025 13:36
Springer made a bunch of books available for free, these were the direct links
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
@romaonthego
romaonthego / NSDateFormatter cheat sheet
Last active April 7, 2025 11:05
Date Formats for NSDateFormatter
a: AM/PM
A: 0~86399999 (Millisecond of Day)
c/cc: 1~7 (Day of Week)
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday
d: 1~31 (0 padded Day of Month)
D: 1~366 (0 padded Day of Year)