Skip to content

Instantly share code, notes, and snippets.

View pm-dev's full-sized avatar

Peter Meyers pm-dev

  • Nextdoor
  • New York, NY
View GitHub Profile
/**
Here's an example of how data flows from UI to/from the data model
with the current implementation.
*/
class ActionBar : UIView {
var handle: Any?
using namespace std;
Node* LineManager::lineManagerRec(Vector<Line *>& sortedLines, int start, int end) {
if (start > end) {
return NULL;
}
int middleIdx = (end + start) / 2;
Line *middle = sortedLines[middleIdx];
Node *root = new Node();
root->thisLine = middle;
@pm-dev
pm-dev / ApplesToOranges.kt
Last active April 30, 2018 16:45
Better type-safety with units in Kotlin
// Here's how unit type-safety can prevent you from performing invalid unit arithmetic
fun main(args: Array<String>) {
val oranges = Oranges(4)
val apples = Apples(4)
// Will result in compile time error:
println("Can't compare apples to oranges: ${apples == oranges}")
println("Can't add two unknown things to my apples: ${apples + 2}")
//
// OPModel.h
// OperatoriOS
//
// Created by Peter Meyers on 4/16/15.
// Copyright (c) 2015 Peter Meyers. All rights reserved.
//
#import <CoreData/CoreData.h>
{
"version": "1.0.0",
"original_product": {
"product_id": "2434285",
"title": "Original Product",
"price": "$69.00",
"retail_price": "$100.00",
"availability": "AVAILABLE",
"is_vintage": "0",
"image_urls": [
@interface CBImageStore () <NSURLSessionTaskDelegate>
@property (nonatomic, strong) NSMapTable *imageTaskCompletionsByTaskID;
@property (nonatomic, strong) NSMapTable *imageURLTaskCompletionsByTaskID;
@property (nonatomic, strong) NSURLSession *nsurlsession;
@end
@implementation CBImageStore
diff --git a/koality.yml b/koality.yml
index fdfe306..68c48c6 100644
--- a/koality.yml
+++ b/koality.yml
@@ -1,26 +1,27 @@
--- #Koality: 0.0.1
languages:
ruby: 1.9.3
setup:
- packages:
diff --git a/rails/app/controllers/api/v0/mobile_search_controller.rb b/rails/app/controllers/api/v0/mobile_search_controller.rb
index 6006be0..ab824ef 100644
--- a/rails/app/controllers/api/v0/mobile_search_controller.rb
+++ b/rails/app/controllers/api/v0/mobile_search_controller.rb
@@ -16,29 +16,16 @@ module Api
render :json => MultiJson.dump(response_json)
end
+ protected