Skip to content

Instantly share code, notes, and snippets.

@Kapeli
Kapeli / build_libarchive_3_for_ios_8_and_above.md
Created November 14, 2020 14:38 — forked from davepeck/build_libarchive_3_for_ios_8_and_above.md
How to build libarchive 3 (or, really, any autotools-based library) for iOS 8+

How to build libarchive 3 (and, really, any autotools based library) for iOS 8+

It's easy:

  1. Grab iOS-autotools by @szanni from https://github.com/szanni/ios-autotools
  2. Grab libarchive 3 from http://www.libarchive.org/
  3. cd into the libarchive code directory
  4. export ARCHS="armv7 armv7s arm64" (or suitable for your needs and your shell of choice)
  5. Run autoframework ArchiveLib libarchive.a and wait for everything to build!
@Kapeli
Kapeli / NSCrapField.m
Last active March 9, 2020 18:57
Yosemite NSSearchField Fixes
// 1. Disable centered look & animation:
// 1.1. Subclass NSSearchFieldCell and add:
- (BOOL)isCenteredLook
{
return NO;
}
// 1.2. Subclass NSSearchField and add:
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update
{
NSString *bestMirror = [[DHLatencyTester sharedLatencyTester] bestMirror];
if(bestMirror)
{
[update setFileURL:[NSURL URLWithString:[bestMirror stringByAppendingPathComponent:@"Dash.zip"]]];
}
}
@Kapeli
Kapeli / cdn.js
Created February 25, 2014 22:17
function latencyTest(url) {
$.ajax({
url: "http://"+url+".kapeli.com/feeds/latencyTest_v2.txt",
cache: false,
success: function(content){
if(beginsWith("Just a latency test. Move along.", content))
{
var link = document.getElementsByClassName("downloadButton")[0];
if(link.getAttribute("href") == "Dash.zip")
{
@Kapeli
Kapeli / gist:5017177
Created February 22, 2013 22:43 — forked from yjsoon/gist:3474117
" Search Dash for word under cursor
function! SearchDash()
let s:browser = "/usr/bin/open"
let s:wordUnderCursor = expand("<cword>")
let s:url = "dash://".s:wordUnderCursor
let s:cmd ="silent ! " . s:browser . " " . s:url
execute s:cmd
redraw!
endfunction
map <leader>d :call SearchDash()<CR>