Skip to content

Instantly share code, notes, and snippets.

@goshacmd
goshacmd / fix_sys_rb.sh
Created June 12, 2013 07:41
OS X [REDACTED] Ruby 2.0 headers fix.
sys_rb_usr=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr
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
@silvenon
silvenon / 0.Readme.md
Last active April 11, 2019 08:45
An example dropdown using Tether Drop, React Portal and 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.

Notes

@MoOx
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
# ...
[options]
# 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'
@iwarshak
iwarshak / Gemfile
Last active May 12, 2018 21:54
Here is what you need to get your Rubymotion application logs sent to papertrailapp.com. 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…
source :rubygems
gem "rake"
gem 'motion-logger' #cocoalumberjack wrapper
@evnm
evnm / vertical-split-screen-patch
Created December 31, 2010 22:40
CLI example of patching GNU Screen to support vertical window splitting
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/screen co screen
$ curl http://old.evanmeagher.net/files/gnu-screen-vertsplit.patch > 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
@interface ExtendedManagedObject : NSManagedObject {
BOOL traversed;
}
@property (nonatomic, assign) BOOL traversed;
- (NSDictionary*) toDictionary;
- (void) populateFromDictionary:(NSDictionary*)dict;
+ (ExtendedManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict
inContext:(NSManagedObjectContext*)context;

NavigationExperimental notes

Containers

RootNavigationContainer

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