Skip to content

Instantly share code, notes, and snippets.

View jarek-foksa's full-sized avatar

Jarek Foksa jarek-foksa

View GitHub Profile
[
"abandon",
"abbey",
"ability",
"able",
"abnormal",
"abolish",
"abortion",
"abridge",
"absence",
- (void)init {
[self test:@0]; // prints 0
[self test:@1]; // prints 0
[self test:@2]; // prints 0
}
- (void)test:(NSNumber *)arg {
[doAsyncStuff callback:^(void) {
NSLog(@"arg %@", arg);
}];
- (BOOL)validateUserInterfaceItem:(id)menuItem {
id firstResponder = [[[NSApplication sharedApplication] keyWindow] firstResponder];
[[self webView] postMessage:@"getMenuItemDescriptor" args:@[command] callback:^(NSArray *response) {
NSString *label = response[0]
[menuItem setTitle:label];
}];
(lldb) bt
* thread #3: tid = 0x3203, 0x00007fff8b799d16 libsystem_kernel.dylib`kevent + 10
frame #0: 0x00007fff8b799d16 libsystem_kernel.dylib`kevent + 10
frame #1: 0x00007fff8cc3cdea libdispatch.dylib`_dispatch_mgr_invoke + 883
frame #2: 0x00007fff8cc3c9ee libdispatch.dylib`_dispatch_mgr_thread + 54
WebCore`void WebCore::effectType<(WebCore::ColorMatrixType)1>(WTF::Uint8ClampedArray*, WTF::Vector<float, 0ul> const&):
0x7fff852ac310: pushq %rbp
0x7fff852ac311: movq %rsp, %rbp
0x7fff852ac314: pushq %r15
0x7fff852ac316: pushq %r14
0x7fff852ac318: pushq %rbx
0x7fff852ac319: movl 56(%rdi), %r8d
0x7fff852ac31d: testl %r8d, %r8d
0x7fff852ac320: je 0x7fff852ac5ed ; void WebCore::effectType<(WebCore::ColorMatrixType)1>(WTF::Uint8ClampedArray*, WTF::Vector<float, 0ul> const&) + 733
0x7fff852ac326: xorl %r15d, %r15d
NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:@[@"1.0"] forKeys:@[@"NSImageCompressionFactor"]];
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithData:[img TIFFRepresentation]];
NSData *png = [imageRep representationUsingType:NSPNGFileType properties:dictionary];
# The angle can be in range 0 - 360 and is measured clockwise starting from hour 12
# vector1 is the reference vector
getAngleBetweenTwoVectors: (vector1, vector2) ->
angleRad = atan2(vector2.y, vector2.x) - atan2(vector1.y, vector1.x)
angle = angleRad * (180/pi)
angle = 360 - abs(angle) if angle < 0
return angle
# @authors
# Jarosław Foksa <https://github.com/jarek-foksa>
#
# @copyright
# Copyright © 2012 by Jarosław Foksa
#
# @license
# Boxy License </doc/licenses/boxy-license.md>
@jarek-foksa
jarek-foksa / storage.json
Created December 5, 2012 15:59
storage.json
{
"accuracyHistory" : [
100,
93,
100,
100,
97,
98,
95,
98,
cp /Applications/Type\ Fu.app/Contents/Resources/client/data/defaults/storage.json ~/Library/Containers/com.type-fu.TypeFu/Data/Library/Application\ Support/Type\ Fu/storage.json