Skip to content

Instantly share code, notes, and snippets.

@stong
stong / cups-browsed.md
Last active October 8, 2024 18:53
CUPS disclosure leaked online. Not my report. The original author is @evilsocket

Original report

  • Affected Vendor: OpenPrinting
  • Affected Product: Several components of the CUPS printing system: cups-browsed, libppd, libcupsfilters and cups-filters.
  • Affected Version: All versions <= 2.0.1 (latest release) and master.
  • Significant ICS/OT impact? no
  • Reporter: Simone Margaritelli [[email protected]]
  • Vendor contacted? yes The vendor has been notified trough Github Advisories and all bugs have been confirmed:
@molind
molind / SortedDictionary.swift
Last active September 7, 2020 11:36
SortedDictionary used to sort contents before JSON serialization
// We have a parent just to pass face control in JSONSerialization
@objc class SortedDictionary: NSDictionary {
let _values: NSMutableArray = []
let _keys: NSMutableOrderedSet = []
override var count: Int {
return _keys.count
}
override func keyEnumerator() -> NSEnumerator {
//
// Copyright (c) 2016, 2018 Nikolai Ruhe. All rights reserved.
//
import Foundation
public extension FileManager {
/// Calculate the allocated size of a directory and all its contents on the volume.
@lukaskollmer
lukaskollmer / hack.m
Created June 21, 2016 15:30
UITextView: Allow tapping links from NSAttributedString, but disallow text selection
/**
Note to self:
This UITextView class extension gets calles every time iOS wants to add a new gesture recognizer to the textView.
It checks for the type of the gesture recognizer (Long Press) and then for the associated action.
Only if the action is ``smallDelayRecognizer:``, the gestuere recognizer will stay enabled.
All otheer long press gestures will be disabled.
Purpose:
Allow user interaction with the links in the attributedText, but disallow text selection
@Coeur
Coeur / README.md
Last active October 18, 2020 21:41 — forked from lopezjurip/README.md
Write to NTFS on OSX Yosemite and El Capitan
@natecook1000
natecook1000 / operatorCharacters.swift
Last active September 2, 2024 22:07
Allowed characters for Swift operators
import Foundation
extension UnicodeScalar : ForwardIndexType {
public func successor() -> UnicodeScalar {
return UnicodeScalar(value + 1)
}
}
var operatorHeads: [UnicodeScalar] = Array("=-+!*%<>&|^~?".unicodeScalars)
operatorHeads += Array("\u{00A1}" ... "\u{00A7}")
@BenziAhamed
BenziAhamed / CGCreatePattern.swift
Last active May 24, 2022 22:24
Demonstration of using CGCreatePattern in Swift
//: Playground - noun: a place where people can play
//: Copy this to one!
import UIKit
// With helpful insights from
// https://forums.developer.apple.com/message/15725#15725 via http://oleb.net/blog/2015/06/c-callbacks-in-swift/
// This is essential the standalone basic definition of a pattern
// that CGCreatePattern requires
@Coeur
Coeur / ARCHelper.h
Created October 11, 2012 08:03 — forked from nicklockwood/ARCHelper.h
ARC Helper
//
// ARC Helper
//
// Version 2.1
//
// Created by Nick Lockwood on 05/01/2012.
// Copyright 2012 Charcoal Design
//
// Distributed under the permissive zlib license
// Get the latest version from here:
@atomicbird
atomicbird / NSObject+setValuesForKeysWithJSONDictionary.h
Created January 11, 2012 02:35
NSObject category for handling JSON dictionaries. Described in detail at http://www.cimgf.com/2012/01/11/handling-incoming-json-redux/
//
// NSObject+setValuesForKeysWithJSONDictionary.h
// SafeSetDemo
//
// Created by Tom Harrington on 12/29/11.
// Copyright (c) 2011 Atomic Bird, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@nicklockwood
nicklockwood / ARCHelper.h
Last active November 20, 2018 10:02
ARC Helper
//
// ARC Helper
//
// Version 2.2
//
// Created by Nick Lockwood on 05/01/2012.
// Copyright 2012 Charcoal Design
//
// Distributed under the permissive zlib license
// Get the latest version from here: