Skip to content

Instantly share code, notes, and snippets.

@blach
blach / XDocumentSource.h
Created August 13, 2018 16:37
XDocumentSource File Provider Service
//
// XDocumentSource.h
// Textastic Universal
//
// Created by Alexander Blach on 01.05.18.
//
#import <Foundation/Foundation.h>
@protocol XDocumentSourceProtocol
@blach
blach / airpod_availability.html
Last active April 17, 2017 02:50
Checks AirPod store availability by using JavaScript to query Apple's servers. Created with Textastic and works great with its built-in web preview. Uses YQL and JSONP to work around JavaScript's same origin policy. Inspired by https://gist.github.com/omarshahine/f8eb4598af4f1767ab1a9f01662e74b1
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title>Check AirPod availability in Apple Stores</title>
<style>
body {
font-size: 12px;
@blach
blach / SymbolList.m
Last active August 29, 2015 14:01
Symbol list icon mapping
[self addSymbolMappingWithScopeSelectorString:@"meta.function, meta.method" imageName:@"symbol_list_function"];
[self addSymbolMappingWithScopeSelectorString:@"meta.class, meta.interface-or-protocol" imageName:@"symbol_list_class"];
[self addSymbolMappingWithScopeSelectorString:@"meta.module, meta.directive.module, source meta.implementation entity.name.type" imageName:@"symbol_list_module"];
[self addSymbolMappingWithScopeSelectorString:@"meta.directive.define, meta.preprocessor" imageName:@"symbol_list_define"];
[self addSymbolMappingWithScopeSelectorString:@"meta.tag" imageName:@"symbol_list_tag"];
[self addSymbolMappingWithScopeSelectorString:@"markup.heading" imageName:@"symbol_list_heading"];
@blach
blach / gist:2757471
Created May 20, 2012 09:23
Code excerpt from Textastic's cursor navigation wheel. Shows how the move button is implemented.
- (void) awakeFromNib {
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGesture:)];
[buttonMove addGestureRecognizer:panGesture];
[panGesture release];
}
- (void) setupMoveTransform:(BOOL) move {
CATransform3D targetTransform = CATransform3DMakeScale(1.1f, 1.1f, 1.0f);
targetTransform = CATransform3DTranslate(targetTransform, -6, -6, 0.0f);