This file contains hidden or 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 CellLayout < MotionKit::Layout | |
| include CommonStyles | |
| def layout | |
| root :cell do | |
| add contentView, :content_view do | |
| add(UIView, :container) { cell_content_layout } | |
| end | |
| end | |
| end |
This file contains hidden or 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
| use GuzzleHttp\Client; | |
| $client = new Client([ | |
| 'base_uri' => 'https://api.contactually.com', | |
| 'headers' => [ | |
| 'Accept': 'application/json', | |
| 'Authorization': 'Bearer AUTH_TOKEN_HERE' | |
| ], | |
| ]); |
This file contains hidden or 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
| curl https://api.contactually.com/v2/me \ | |
| -H "Authorization: Bearer YOUR_TOKEN_HERE" \ | |
| -H "Content-Type: application/json" |
This file contains hidden or 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 requests | |
| client = http.client.HTTPSConnection('api.contactually.com') | |
| host = 'https://api.contactually.com' | |
| headers = { | |
| 'Accept': 'application/json', | |
| 'Authorization': 'Bearer YOUR_TOKEN_HERE' | |
| } |
This file contains hidden or 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
| require 'faraday' | |
| require 'faraday_middleware' | |
| client = Faraday.new( | |
| url: 'https://api.contactually.com', | |
| headers: { | |
| 'Accept': 'application/json', | |
| 'Authorization': 'Bearer YOUR_TOKEN_HERE' | |
| } | |
| ) do |connection| |
This file contains hidden or 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
| { | |
| :iphone_4 => 'iPhone 4s', | |
| :iphone_5 => 'iPhone 5', | |
| :iphone_6 => 'iPhone 6', | |
| :iphone_6_plus => 'iPhone 6 Plus', | |
| :ipad => 'iPad Retina', | |
| :ipad_air => 'iPad Air' | |
| }.each do |rake_task, device| | |
| default_task = "bundle exec rake device_name=\"#{device}\"" |
This file contains hidden or 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
| module SwipeableCell | |
| ANIMATION_DURATION = 0.2 | |
| MAX_TRANSITION_ALPHA = 0.5 | |
| SWIPE_THRESHOLD = 110 | |
| LONG_SWIPE_THRESHOLD = SWIPE_THRESHOLD + 80 | |
| FADE_IN_DISTANCE = SWIPE_THRESHOLD | |
| def gestureRecognizer(recognizer, | |
| shouldRecognizeSimultaneouslyWithGestureRecognizer: other_recognizer) | |
| return true unless recognizer.is_a? UIPanGestureRecognizer |
This file contains hidden or 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
| module ContactuallyApi | |
| module Models | |
| class Contact < Base | |
| include NameHelper | |
| ATTRIBUTES = CORE_ATTRIBUTES + [ | |
| :addresses, | |
| :avatar_url, | |
| :company, | |
| :email_addresses, |
This file contains hidden or 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
| module ContactuallyApi | |
| module Resources | |
| module Contacts | |
| RESOURCE_URL_BASE = 'api/v2/contacts'.freeze | |
| def contact_index(params = nil, &block) | |
| path = RESOURCE_URL_BASE | |
| ContactuallyApi.client.get(path, params, &block) | |
| end |
This file contains hidden or 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 CustomCell < UITableViewCell | |
| def initWithStyle(style, reuseIdentifier: identifier) | |
| super | |
| @layout = CustomCellLayout.new(root: WeakRef.new(self)).build | |
| self | |
| end | |
| def obj=(obj) | |
| @layout.foo = obj[:foo] | |
| @layout.bar = obj[:bar] |
NewerOlder