This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var thisDict; | |
thisDict = [CPDictionary dictionaryWithObjectsAndKeys: appLauncherView, | |
CPViewAnimationTargetKey, | |
(open) ? CPViewAnimationFadeOutEffect : CPViewAnimationFadeInEffect, | |
CPViewAnimationEffectKey]; | |
[anims addObject:thisDict]; //BOOL open determines which effect will occur | |
animation = [[CPViewAnimation alloc] initWithViewAnimations:anims]; | |
//[animation setAnimationBlockingMode:CPAnimationBlocking]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
@class STWindow.j | |
@abstract Custom CPWindow class for apps | |
@detail STWindow is the default window class for apps in StockTwits Desktop. This window class is made to be subclassed. | |
To enable the menu items, window controllers of the subclass must implement -newWindow: and -showPreferences: | |
*/ | |
@import <AppKit/AppKit.j> | |
@import <Foundation/Foundation.j> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import <AppKit/AppKit.j> | |
@import <Foundation/Foundation.j> | |
@implementation STSplitView : CPSplitView | |
{ | |
} | |
- (id)initWithFrame:(CGRect)frame { | |
self = [super initWithFrame:frame]; | |
if (self) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AppBadgeViewDragType = "AppBadgeViewDragType"; | |
function hypot(x,y) { | |
var hyp = Math.sqrt(x*x + y*y); | |
return hyp; | |
} | |
@implementation AppBadgeItemView : CPView | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* More info at: http://phpjs.org | |
* http://phpjs.org/functions/index | |
* | |
* php.js is copyright 2009 Kevin van Zonneveld. | |
* Dual licensed under the MIT (MIT-LICENSE.txt) | |
* and GPL (GPL-LICENSE.txt) licenses. | |
* | |
* Conversion to Objective-J copyright 2009 Philippe Laval | |
* Licenced under the same MIT, GPL dual licences. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* STAttachedWindow.j | |
* stocktwits-desktop-2 | |
* | |
* Created by Daniel Brajkovic on 12/13/10. | |
* Copyright Witton Technology Group 2010. All rights reserved. | |
*/ | |
@import "TNAttachedWindow.j" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
#1: Simple POST | |
res = Net::HTTP.post_form(URI.parse('http://www.example.com/search.cgi'), | |
{'q'=>'ruby', 'max'=>'50'}) | |
puts res.body | |
#2: POST with basic authentication | |
res = Net::HTTP.post_form(URI.parse('http://jack:[email protected]/todo.cgi'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+(void)updateAccount:(CPDictionary)accountParams delegate:(id)delegate | |
{ | |
var urlString = [CPString stringWithFormat:@"http://api.webservice.com/account/update.json"]; | |
var request = [self requestWithURLString:urlString]; | |
var name = [accountParams valueForKey:@"name"]; | |
var username = [accountParams valueForKey:@"username"]; | |
var email = [accountParams valueForKey:@"email"]; | |
var postBody = [CPString stringWithFormat:@"name=%@&username=%@&email=%@", name, username, email]; | |
[request setValue:[postBody length] forHTTPHeaderField:@"Content-Length"]; | |
[request setHTTPMethod:@"POST"]; |