Moved to github.com/andreyvit/OCISL.
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 <UIKit/UIKit.h> | |
@class PageInfo; | |
@protocol PageViewControllerDelegate; | |
@interface PageViewController : NSObject { | |
NSInteger pageIndex; |
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
<?php | |
// FPDI extension that preserves hyperlinks when copying PDF pages. | |
// | |
// (c) 2012, Andrey Tarantsov <[email protected]>, provided under the MIT license. | |
// | |
// Published at: https://gist.github.com/2020422 | |
// | |
// Note: the free version of FPDI requires unprotected PDFs conforming to spec version 1.4. | |
// I use qpdf (http://qpdf.sourceforge.net/) to preprocess PDFs before running through this |
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
#! /bin/bash | |
# vim: sw=2 ts=2 et ai | |
NUM_OLDEST_BACKUPS_TO_KEEP=1 | |
NUM_RECENT_BACKUPS_TO_KEEP=100 | |
NUM_MONTHS_TO_KEEP_DAILY_BACKUPS=4 | |
AUTOMATIC_REMOVAL_THRESHOLD=40 | |
# Deletes old DB backup files from the folder specified as an argument. | |
# |
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 <Foundation/Foundation.h> | |
typedef enum { | |
AppVisibilityModeNone, | |
AppVisibilityModeDock, | |
AppVisibilityModeMenuBar | |
} AppVisibilityMode; |
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
<?php | |
// Works: browsing, logging in, file downloads, images attached to KB articles | |
// Doesn't work: posting, file uploads | |
error_reporting(E_ERROR); | |
// phpinfo(); exit; | |
define('OUR_HOST', 'livereload.com'); | |
define('THEIR_HOST', 'livereload.tenderapp.com'); |
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
desc "Install zsh config" | |
task :zshconfig do | |
sh 'chsh -s /bin/zsh' | |
sh 'rm -f ~/.zshrc ~/.zshenv' | |
sh 'ln -s ~/env/config/zshenv ~/.zshenv' | |
sh 'ln -s ~/env/config/zshrc ~/.zshrc' | |
end | |
desc "Install ssh config" | |
task :sshconfig do |
Native side handles the view layer of MVC, while the Node.js backend handles the controller (and model) layers.
Goals:
- Pleasant and artful code on the backend side
- No boilerplate code on the native side
- Keeping the native side to a reasonable minimum (stuff like 'stringByAppendingString' or 'WS_EX_ACCEPTFILES' should still reside in the native land!)
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
module.exports = class MainWindowUI | |
show: (callback) -> | |
@window = new UIWindow 'MainWindow', | |
addProjectButton: new UIButton | |
click: => | |
LR.log.fyi "Clicked Add Project button" | |
removeProjectButton: new UIButton | |
click: => | |
LR.log.fyi "Clicked Remove Project button" |
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
// Fakes an Objective-C class out of a C++ class. | |
// | |
// Note that this is a very bad and completely superfluous idea, but after looking up a way | |
// to build Objective-C classes at run time, I just had to do this no matter what. (Besides, | |
// I really hated maintaining mutual pointers in UIElement/UIElementDelegate class pairs.) | |
// | |
// Building up a whole class from scratch (objc_allocateClassPair) looked like a lot of trouble, | |
// so I compile a real Objective-C class instead, but instead of instantiating it by regular means | |
// (alloc/init or class_createInstance), I simply cast a part of a C++ object to (id). | |
// I've looked at the source code for class_createInstance and this hack should work perfectly, |