Skip to content

Instantly share code, notes, and snippets.

View CTMacUser's full-sized avatar

Daryle Walker CTMacUser

View GitHub Profile
@adamgit
adamgit / .gitignore
Last active June 2, 2024 09:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
#include <boost/array.hpp>
namespace boost
{
template<typename T>
inline boost::array<T, 0>
make_array()
{
boost::array<T, 0> res;
@ole
ole / update_storyboard_strings.sh
Last active April 4, 2022 06:11
Automatically extract translatable strings from Xcode storyboards and update .strings files. Original version by MacRumors forum user mikezang (http://forums.macrumors.com/showpost.php?p=16060008&postcount=4). Slightly updated by Ole Begemann. NOTE: this Gist moved to a regular repo at https://github.com/ole/Storyboard-Strings-Extraction.
# (File moved to https://github.com/ole/Storyboard-Strings-Extraction)
@lichray
lichray / make_array.cc
Last active August 29, 2023 16:37
Factory function of std::array
#include <array>
#include <functional>
template <typename... T>
using common_type_t = typename std::common_type<T...>::type;
template <typename T>
using remove_cv_t = typename std::remove_cv<T>::type;
template <bool, typename T, typename... U>
@hlung
hlung / CocoaAsyncSocket startTLS_without_cert.m
Last active August 22, 2017 21:38
CocoaAsyncSocket (https://github.com/robbiehanson/CocoaAsyncSocket) code for where/how to run -startTLS: method. We are connecting to server with self-signed certificate and don't include the certificate (public key .pem) in the client.
#pragma mark - GCDAsyncSocketDelegate
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(uint16_t)port {
[self secureSocket:sock];
}
// We are connecting to server with self-signed certificate and don't include the certificate
// (public key .pem) in the client. So we skip all the cert checking. To actually check, see
// http://stackoverflow.com/questions/9874932/ssl-identity-certificate-to-run-an-https-server-on-ios
- (void)secureSocket:(GCDAsyncSocket *)sock {
// It has been changed in CocoaAsyncSocket v7.4, some old option keys are now unavailable and will throw exception.
// Use GCDAsyncSocketManuallyEvaluateTrust and evaluate in -socket:didReceiveTrust: delegate instead.
#!/bin/sh
# FindInFile.sh
#
#
# Created by Gregory Hill on 2/28/13.
#
# Usage:
# ./FindInFile.sh <baseDir>
# e.g. ~/Desktop/Code/Pandora/dev/Pandora
@jerrykrinock
jerrykrinock / SSYShipProduct.pl
Last active July 4, 2018 21:49
This script is for shipping OS X apps outside the Mac App Store. It will run you through a comprehensive quality-control checklist, supports alpha, beta and production channels, builds the product (or re-ships a previous build to a different channel), codesigns all components with Developer ID per Apple TN2206, builds the Help Book from Markdown…
#!/usr/bin/perl
=com
PURPOSE
This script will
Force you through a comprehensive quality-control checklist
Run Deploymate
Get the latest version number by reading it from product's Info.plist
@SteveBenner
SteveBenner / unbrew.rb
Last active January 3, 2024 01:44
Homebrew uninstall script
#!/usr/bin/env ruby
#
# CLI tool for locating and removing a Homebrew installation
# http://brew.sh/
#
# Copyright (C) 2014 Stephen C. Benner
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@d-ronnqvist
d-ronnqvist / Thoughts on removedOnCompletion in SparkRecordingCircle.md
Last active May 16, 2020 02:51
What I think is wrong with the Spark Recording Circle code and why

There was [a tweet][tweetSoto] a couple of days ago that resulted in a discussion/question about what it wrong with the usage of removedOnCompletion = NO in the [SparkRecordingCircle code][code] for that [Subjective-C post][post].

We all kept saying that the explanation doesn't fit in a tweet, so here is my rough explanation about the issues.

But, let me first say that I think that the Subjective-C articles are reallt cool and useful to learn from. This is trying to reason about the general usage of removedOnCompletion = NO, using that code as an example, since that was what was discussed on twitter.


The root problem, as [Nacho Soto pointed out][rootProblem], is that removedOnCompletion = NO in combination with fillMode = kCAFillModeForwards is almost always used when you are not updating the model layer. This means that after the animation has finished, what you see on screen is not reflected in the property of the layer. The biggest issue that this can cause is that all the

// Asynchronous read
let task = NSURLSession.sharedSession().streamTaskWithHostName("chat.example.com", port: 5555)!
task.resume()
task.readDataOfMinLength(16384, maxLength:65536, timeout: 30.0) {
(data: NSData?, eof: Bool, error: NSError?) in
//
}