Skip to content

Instantly share code, notes, and snippets.

chrisballinger / gist:3352890
Created Aug 14, 2012 — forked from quietcricket/gist:1593632
Fuzzy string match objective-c (Levenshtein Distance Algorithm)
View gist:3352890
-(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
chrisballinger /
Last active Mar 21, 2018
Opens a local file on GitHub (macOS)
#!/usr/bin/env bash
set -e
FILE_DIR="$(dirname "${FILE_PATH}")"
cd ${FILE_DIR}
GIT_ROOT="$(git rev-parse --git-dir)/.."
REMOTES="$(git remote -v)"
GITHUB_REPO="$(sed 's/.*\(.*\).git.*/\1/' <<< "${REMOTES}" | head -1)"
GITHUB_PATH="$(/usr/local/bin/grealpath --relative-to="${GIT_ROOT}" "${FILE_PATH}")"
chrisballinger / dino.rb
Last active Nov 23, 2017
Homebrew formular for dino.
View dino.rb
class Dino < Formula
desc "Modern Jabber/XMPP Client using GTK+/Vala "
homepage ""
## TODO: This is not really a version, but a dummy that's not going to work.
# url ""
# sha256 "a951b50559671ab30e74304ddc66c943405c8ad1bcbe4d77bef647a081fd0dbb"
head do
url ""
chrisballinger / gist:7239932
Last active Nov 21, 2017
French Encryption Import Compliance
View gist:7239932

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:

View gist:cc6ed7c8ae4e7a312c8877d22ca5589b
Incident Identifier: 6DFD9061-7147-422C-876C-2929D148418E
CrashReporter Key: 198c663abe575c4280231dd26697796d750f7a31
Hardware Model: iPhone9,4
Process: ChatSecure [24039]
Path: /var/containers/Bundle/Application/4B3E8D39-6189-413E-BA9E-630C40183E9B/
Identifier: com.chrisballinger.ChatSecure
Version: 4.0 (54)
Code Type: ARM-64
Parent Process: ? [1]
# 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)])
return "".join([chr(ord(x) ^ ord(y)) for (x, y) in zip(a, b[:len(a)])])
def scan_for_letter(character):
View gist:6733678
*** broken file ***
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
chrisballinger / gist:6566091
Last active Dec 23, 2015
ffmpeg arm64 compilation errors
View gist:6566091
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 / gist:3430478
Created Aug 22, 2012
libotr-4.0.0-rc1 build error
View gist:3430478
mbp:OTRKit chrisbal$ ./
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 / gist:1522224
Created Dec 26, 2011
hqx homebrew installation failure
View gist:1522224
mbp:local chrisbal$ brew install -v hqx
==> Downloading
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...
You can’t perform that action at this time.