Skip to content

Instantly share code, notes, and snippets.

@laser
laser / annoying.m
Last active August 29, 2015 14:07
ugh
RACSignal *req;
switch (verb) {
case GET:
req = [[self requestManager] rac_GET:path parameters:parameters];
break;
case POST:
req = [[self requestManager] rac_POST:path parameters:parameters];
break;
}
@laser
laser / ghci.md
Last active August 29, 2015 14:07
Basic GHCI Commands

Running the REPL (GHCI)

~/dev> ghci
GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
:Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... tlinking ... done.
Prelude>
@laser
laser / ListingsViewModel.m
Last active August 29, 2015 14:06
LoginViewController.m
@implementation WMListingsViewModel
- (id)init {
// combine bounding box and type signals and then feed through api to get current listings
_currentListings = [[[[[RACSignal
combineLatest:@[allBoundingBoxSources,
_currentType,
combinedFilters]
reduce:toListingQuery]
@laser
laser / pod_install_error.txt
Created September 24, 2014 18:12
pod install error
Preparing
Analyzing dependencies
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
### Report
* What did you do?
* What did you expect to happen?
@laser
laser / table.md
Last active August 29, 2015 14:06
table markdown
| message number | messageWindow array-length | 
|----------------|----------------------------|  
| 1              | 1                          |  
| 2              | 2                          |  
| 3              | 3                          |  
| ...            | ...                        |  
| 20             | 20                         |  
| 21             | 1                          | 
@laser
laser / flatmap_diag.md
Created September 24, 2014 06:07
flatmap diag
messages: [socket1, msg1] --> [socket1, msg2] --> [socket3, msg3] --> [socket2, msg4]
@laser
laser / socket_diag.md
Created September 24, 2014 06:06
socket diagram
socket1 --> socket2 --> socket3
   |           |           |
   v           v           v
  msg1        msg4        msg3
   |
   v
  msg2
@laser
laser / stream_md.md
Last active August 29, 2015 14:06
stream markdo
connections: socket1 --> socket2 --> socket3
@laser
laser / function_log.js
Last active August 29, 2015 14:06
functional logging
function tag(label) {
return function(value) {
return [label, value];
};
}
Bacon.mergeAll(
connections.map(tag("connection")),
messages.map(tag("message")),
entries.map(tag("entry")),
@laser
laser / combinator error.js
Created September 24, 2014 06:04
combinator erro
var streamC = streamB.flatMap(function() {
var x = undefined;
x.foo(); // undefined is not a function
});
streamC.onError(function(err) {
// does not catch 'undefined is not a function'
});