This file contains 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 { AxiosInstance } from "axios"; | |
import RxAxios from 'axios-observable'; | |
import { delay, map, Observable, of, Subscription } from "rxjs"; | |
export class Session { | |
constructor( | |
readonly accessToken: string, | |
readonly client: string, | |
readonly uid: string, | |
readonly expiry: string |
This file contains 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 | |
protocol User { | |
var firstName: String { get } | |
var lastName: String { get } | |
func fullName() -> String | |
} | |
class CurrentUser: User { |
This file contains 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 | |
struct User { | |
let firstName: String | |
let lastName: String | |
func fullName() -> String { | |
return "\(firstName) \(lastName)" | |
} | |
} |
This file contains 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 | |
// this is either a third party SDK interface or your own analytics client implementation | |
// that actually sends JSON across the wire to deliver tracked analytics events | |
protocol AnalyticsClient { | |
func sendAnalyticsDataToTheBackend(_ eventJSON: [String: Any]) | |
} | |
final class ConcreteAnalyticsClient: AnalyticsClient { | |
func sendAnalyticsDataToTheBackend(_ eventJSON: [String: Any]) { |
This file contains 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
// | |
// HLPlaceResourceManager.h | |
// HeyLets2 | |
// | |
// Created by Alex Bush on 11/18/14. | |
// Copyright (c) 2014 HeyLets. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains 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
class BooleanValue < Value | |
end |
This file contains 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
def for_scope(scope, user = GuestUser.new) | |
case scope | |
when 'saved' | |
user.saved_articles.scoped | |
when 'my' | |
user.tagged_articles.scoped | |
else | |
scoped | |
end | |
end |
This file contains 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
class Article < ActiveRecord::Base | |
include Categorizable | |
APPROVED = 'approved' | |
PENDING = 'pending' | |
REJECTED = 'rejected' | |
attr_accessible :approved_at, :url, :body, :image, :rating, :state, :title, :news_source_id, :published_at | |
validates :url, :uniqueness => true |
This file contains 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
class Api::Private::ArticlesController < Api::Private::BaseController | |
include ArticlesSearch | |
before_filter :find_or_create_article, except: [:index] | |
PAGE_SIZE = 20 | |
attr_accessor :total_pages | |
def index | |
@articles = Article |
This file contains 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
class Article < ActiveRecord::Base | |
include Categorizable | |
APPROVED = 'approved' | |
PENDING = 'pending' | |
REJECTED = 'rejected' | |
attr_accessible :approved_at, :url, :body, :image, :rating, :state, :title, :news_source_id, :published_at | |
validates :url, :uniqueness => true |
NewerOlder