Skip to content

Instantly share code, notes, and snippets.

View gist:3327056
# Setup dir and repo
mkdir underscore-string
cd underscore-string
git init
# Make some files we'll need
touch package.js smart.json
# Add the submodule and checkout the desired branch
git submodule add git:// lib/underscore.string
MattesGroeger / NSNotificationMatcher.h
Created November 13, 2012 14:44
Matcher for Kiwi testing framework that allows testing notifications.
View NSNotificationMatcher.h
#import "KWHCMatcher.h"
#import "KWMessageTracker.h"
#import "Kiwi.h"
@interface NSNotificationMatcher : NSObject <HCMatcher>
NSDictionary *_userInfo;
+ (id)matcherWithUserInfo:(NSDictionary *)dictionary;

NavigationExperimental notes



  • You pass the reducer to this, it actually ultimately receives all navigation calls via onNavigate, which is mostly equivalent to Redux dispatch. It setState and persisting state. it is like the redux "store"
View ExtendedManagedObject.h
@interface ExtendedManagedObject : NSManagedObject {
BOOL traversed;
@property (nonatomic, assign) BOOL traversed;
- (NSDictionary*) toDictionary;
- (void) populateFromDictionary:(NSDictionary*)dict;
+ (ExtendedManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict
evnm / vertical-split-screen-patch
Created December 31, 2010 22:40
CLI example of patching GNU Screen to support vertical window splitting
View vertical-split-screen-patch
$ cvs -z3 co screen
$ curl > gnu-screen-vertsplit.patch
$ cd screen/src
$ patch < ../../gnu-screen-vertsplit.patch
$ ./configure --enable-locale --enable-telnet --enable-colors256 --enable-rxct_osc
$ make
$ sudo make install
iwarshak / Gemfile
Last active May 12, 2018 21:54
Here is what you need to get your Rubymotion application logs sent to I am using Cocoalumberjack (CLJ) which seems to be the logging framework of choice for Cocoa, motion-logger which is a thin RM wrapper around Cocoalumberjack. CLJ allows you to write your own loggers, which is what PapertrailLogger is. It simply fires off lo…
View Gemfile
source :rubygems
gem "rake"
gem 'motion-logger' #cocoalumberjack wrapper
MoOx / .flowconfig
Last active July 12, 2018 01:44
flow config webpack adjustements to avoid the "Required module not found" for png, css, svg etcc
View .flowconfig
# ...
# webpack loaders
module.name_mapper='.*\.css$' -> '<PROJECT_ROOT>/flow/stub/css-modules.js'
module.name_mapper='.*\.\(svg\|png\|jpg\|gif\)$' -> '<PROJECT_ROOT>/flow/stub/url-loader.js'
silvenon /
Last active April 11, 2019 08:45
An example dropdown using Tether Drop, React Portal and Redux.

Tether Drop + React Portal + Redux

This is an example of using Tether Drop with React Portal (and Redux for managing the state). I was asked if using React Portal is redundant, as both libraries pull the content into the <body>. Using only Drop would cause an invariant violation in React becuase of the DOM mutation, so I'm using React Portal to first bring it outside without React complaining (I don't know how React Portal does it, I haven't checked out the source, but it works). Once it's out of React's supervision, I can apply Drop to it.

  • Dropdown.jsx is the actual dropdown component
  • App.jsx is just an demo that uses it

This is my lazy way out of this limitation using an existing library that has much more features than you need, but chances are that you're going to need a library like React Portal anyway for stuff like modals.


goshacmd /
Created June 12, 2013 07:41
OS X [REDACTED] Ruby 2.0 headers fix.
sdk_rb_usr=`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
sudo cp -r $sdk_rb_usr/include $sys_rb_usr/include
tbranyen / app.js
Created September 22, 2011 16:51
backbone.js sub routing
View app.js
/* Pretend app setup stuff is here */
/* Kick off app */
jQuery(function($) {
var Gallery = app.module("gallery");
app.Router = Backbone.Router.extend({
initialize: function() { = new Gallery.Router("gallery/");