Skip to content

Instantly share code, notes, and snippets.

@chrisballinger
chrisballinger / gist:1522224
Created December 26, 2011 22:32
hqx homebrew installation failure
mbp:local chrisbal$ brew install -v hqx
==> Downloading http://hqx.googlecode.com/files/hqx-1.1.tar.gz
File already downloaded in /Users/chrisbal/Library/Caches/Homebrew
/usr/bin/tar xf /Users/chrisbal/Library/Caches/Homebrew/hqx-1.1.tar.gz
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/hqx/1.1
./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/hqx/1.1
checking for gcc... /usr/bin/llvm-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
@chrisballinger
chrisballinger / hqx.rb
Created December 26, 2011 22:41
hqx homebrew installation file
require 'formula'
class Hqx < Formula
url 'http://hqx.googlecode.com/files/hqx-1.1.tar.gz'
homepage 'http://code.google.com/p/hqx/'
sha1 'bf08ae10db6cce4d29c84524ec13a3101d31db6b'
depends_on 'devil'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
@chrisballinger
chrisballinger / gist:3352890
Created August 14, 2012 20:50 — forked from quietcricket/gist:1593632
Fuzzy string match objective-c (Levenshtein Distance Algorithm)
-(float)compareString:(NSString *)originalString withString:(NSString *)comparisonString
{
// Normalize strings
[originalString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
[comparisonString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
originalString = [originalString lowercaseString];
comparisonString = [comparisonString lowercaseString];
// Step 1 (Steps follow description at http://www.merriampark.com/ld.htm)
@chrisballinger
chrisballinger / gist:3430478
Created August 22, 2012 23:16
libotr-4.0.0-rc1 build error
mbp:OTRKit chrisbal$ ./build-all.sh
Skipping libgpg-error...
Skipping libgcrypt...
Building libotr...
Using libotr-4.0.0-rc1.tar.gz
Building without ccache
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
@chrisballinger
chrisballinger / gist:6566091
Last active December 23, 2015 02:19
ffmpeg arm64 compilation errors
CC libavformat/aacdec.o
In file included from libavformat/a64.c:23:
In file included from ./libavcodec/bytestream.h:31:
In file included from ./libavutil/intreadwrite.h:25:
In file included from ./libavutil/bswap.h:38:
./libavutil/arm/bswap.h:55:41: error: invalid operand for instruction
__asm__ ("eor %1, %0, %0, ror #16 \n\t"
^
<inline asm>:2:14: note: instantiated into assembly here
bic x9, x9, #0xFF0000
@chrisballinger
chrisballinger / gist:6733678
Created September 27, 2013 19:10
ffprobe output
*** broken file ***
[STREAM]
index=1
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Main
codec_type=video
codec_time_base=1/180000
codec_tag_string=[27][0][0][0]
@chrisballinger
chrisballinger / gist:7239932
Last active February 27, 2024 22:21
French Encryption Import Compliance

Starting in the first week of July, apps that meet the following criteria are required to comply with French Encryption Laws/Regulations if you intend to distribute your app in France.

This requirement applies to apps that use, access, implement, or incorporate:

  1. Any encryption algorithm that is yet to be standardized by international standard bodies such as IEEE, IETF, ISO, ITU, ETSI, 3GPP, TIA, etc. or not otherwise published; or
  2. Standard (e.g., AES, DES, 3DES, RSA) encryption algorithm(s) instead of or in addition to accessing or using the encryption in iOS and/or Mac OS X

Apple will require you to upload a copy of your approved French declaration when you submit your app to the App Store. Relevant French encryption regulations can be found at:

#!/usr/bin/python
# Public Domain
def strxor(a, b): # xor two strings of different lengths
if len(a) > len(b):
return "".join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a[:len(b)], b)])
else:
return "".join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a, b[:len(a)])])
def scan_for_letter(character):

Keybase proof

I hereby claim:

  • I am chrisballinger on github.
  • I am chrisballinger (https://keybase.io/chrisballinger) on keybase.
  • I have a public key whose fingerprint is 69D7 DE0D A7A5 1730 73FB DD8D ACEF D02A 50F7 D255

To claim this, I am signing this object:

-[GCDAsyncSocketConnectionTests testTransferFromClient]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2015-08-25 20:16:59.366 xctest[817:4024] [Server] Closed connection: (null)
2015-08-25 20:16:59.368 xctest[817:4024] [Server] Closed connection: (null)
2015-08-25 20:16:59.371 xctest[817:4024] [Server] Closed connection: (null)
2015-08-25 20:16:59.392 xctest[817:4024] [Server] Closed connection: Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo=0x7a06fea0 {NSLocalizedFailureReason=Error in connect() function, NSLocalizedDescription=Connection refused}
2015-08-25 20:17:29.367 xctest[817:4024] *** Assertion failure in -[_XCTestCaseImplementation addExpectation:], /SourceCache/XCTest_Sim/XCTest-7701/XCTestFramework/Classes/XCTestCase.m:1257
2015-08-25 20:17:29.416 xctest[817:4024] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'API violation - creating expectations while already in waiting mode.'
*** First throw call stack:
(