Skip to content

Instantly share code, notes, and snippets.

View koenbok's full-sized avatar

Koen Bok koenbok

View GitHub Profile
@koenbok
koenbok / go.js
Created January 7, 2015 10:56
GoSquared FastSpring
<!-- start gosquared -->
<div>
<script>
!function(g,s,q,r,d){r=g[r]=g[r]||function(){(r.q=r.q||[]).push(
arguments)};d=s.createElement(q);q=s.getElementsByTagName(q)[0];
d.src='//d1l6p2sc9645hc.cloudfront.net/tracker.js';q.parentNode.
insertBefore(d,q)}(window,document,'script','_gs');
_gs('GSN-181913-K');
homeView.states.add
scale: { scale:0.9, opacity:0 }
filterView.states.add
move: { x:0 }
layerNames = ["layerA", "layerB"]
layers = {}
for layerName in layerNames
layers[layerName] = new Layer backgroundColor:"red"
for layerName, layer of layers
print layerName, layer
_webView2 = [[WKWebView alloc] initWithFrame:NSZeroRect configuration:configuration];
WKPageGroupRef pageGroupRef = WKPageGetPageGroup(_webView2.wkView.pageRef);
WKPreferencesRef preferencesRef = WKPageGroupGetPreferences(pageGroupRef);
WKPreferencesSetFileAccessFromFileURLsAllowed(preferencesRef, YES);
NSLog(@"WKPreferencesSetFileAccessFromFileURLsAllowed %ld", (long)WKPreferencesGetFileAccessFromFileURLsAllowed(preferencesRef));
@koenbok
koenbok / WKWebInspector.m
Created March 13, 2015 10:50
WKWebInspector.m
// https://github.com/WebKit/webkit/blob/master/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
@interface WKWebView (WKPrivate)
@property (nonatomic, setter=_setAllowsRemoteInspection:) BOOL _allowsRemoteInspection;
@property (copy, setter=_setCustomUserAgent:) NSString *_customUserAgent;
@end
@interface WKPreferences (WKPrivate)
@property (nonatomic, setter=_setCompositingBordersVisible:) BOOL _compositingBordersVisible;
@property (nonatomic, setter=_setCompositingRepaintCountersVisible:) BOOL _compositingRepaintCountersVisible;
@property (nonatomic, setter=_setTiledScrollingIndicatorVisible:) BOOL _tiledScrollingIndicatorVisible;
@koenbok
koenbok / syntax.coffee
Created June 25, 2015 09:34
Framer Syntax Test
a = "######dssdaadsdsa" ####
# Strings
test?("s", "s") # comma should be white
'abc'
"""
Hello
{EventEmitter} = require "./EventEmitter"
###
top, right, bottom, left, centerX, centerY, center
###
calculateFrame = (layer, rules) ->
val = (rule) =>
value = rules[rule]
# pragma mark Custom caret
- (void)drawInsertionPointInRect:(NSRect)aRect color:(NSColor *)aColor turnedOn:(BOOL)flag {
aRect.size.width = self.caretWidth;
[super drawInsertionPointInRect:aRect color:aColor turnedOn:flag];
}
// This is a hack to get the caret drawing to work. I know, I know.
- (void)setNeedsDisplayInRect:(NSRect)invalidRect {
invalidRect.size.width += self.caretWidth - 1;
@koenbok
koenbok / editors.m
Created September 21, 2015 08:59
Get Available Editors
- (NSArray *)availableEditors
{
NSArray *appNames = @[@"Sublime Text", @"Sublime Text 2", @"Espresso", @"Textmate", @"Coda", @"Chocolat"];
NSMutableArray *result = [[NSMutableArray alloc] init];
for (NSString *appName in appNames) {
NSString *appPath = [[NSWorkspace sharedWorkspace] fullPathForApplication:appName];
if (appPath)
@koenbok
koenbok / CrashReport.txt
Created October 27, 2015 13:58
Framer Studio Crash
Incident Identifier: 5C6E5B98-F0A6-4129-B85A-EE5001CB6552
CrashReporter Key: 6B893A6D-B420-58C5-AEFE-C232A6A6C32C
Hardware Model: MacBookPro12,1
Process: Framer Studio [652]
Path: /Applications/Framer Studio.app/Contents/MacOS/Framer Studio
Identifier: com.motif.framer
Version: v44 (2469)
Code Type: X86-64
Parent Process: launchd [1]