Skip to content

Instantly share code, notes, and snippets.

ooops ooopscc

Block or report user

Report or block ooopscc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ooopscc
ooopscc / karabiner_switch_input_source.json
Created May 24, 2019 — forked from gxfxyz/karabiner_switch_input_source.json
Karabiner-Elements config: switch input source | 输入法切换
View karabiner_switch_input_source.json
{
"title": "Switch input source | 输入法切换",
"rules": [
{
"description": "Tap Command_L (⌘) → Switch input source to English | 短按左 Command (⌘) → 切换到英文输入法",
"manipulators": [
{
"conditions": [
{
"input_sources": [
@ooopscc
ooopscc / PSPDFGenerics.h
Created Mar 15, 2019 — forked from steipete/PSPDFGenerics.h
Override copy and mutableCopy on Objective-C collection classes to pass along both the collection type and the generic info. This is a header-only "library". MIT licensed. Craving for more? foreach: https://gist.github.com/steipete/7e3c69b985165dc23c5ec169b857ff42 even more: https://pspdfkit.com/blog/2016/swifty-objective-c/ - ships in https://p…
View PSPDFGenerics.h
//
// PSPDFGenerics.h
// PSPDFFoundation
//
// PSPDFKit is the leading cross-platform solution for integrating PDFs into your apps: https://pspdfkit.com.
// Try it today using our free PDF Viewer app: https://pdfviewer.io/
//
// This file is MIT licensed.
/**
View ThreadSafeMutableArray.h
//
// Created on 2019/1/25.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface ThreadSafeMutableArray<ObjectType> : NSObject <NSFastEnumeration, NSCopying>
@ooopscc
ooopscc / PSPDFThreadSafeMutableDictionary.m
Created Jan 25, 2019 — 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…
View PSPDFThreadSafeMutableDictionary.m
//
// 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
View ArrayHelpers.swift
extension Array {
func first() -> Element? {
if isEmpty {
return nil
}
return self[0]
}
func last() -> Element? {
@ooopscc
ooopscc / CCDeepCopy.h
Created Dec 8, 2014
Deep Copy Categories for NSArray & NSDictionary
View CCDeepCopy.h
//
// CCDeepCopy.h
//
// Created by ooops on 12/8/14.
// Copyright (c) 2014 http://ooopscc.com. All rights reserved.
//
#import <Foundation/Foundation.h>
#pragma mark - NSArray
You can’t perform that action at this time.