Skip to content

Instantly share code, notes, and snippets.

Avatar
🌊
In Flow

Ashok Raju rajuashok

🌊
In Flow
View GitHub Profile
View actionFooterView.swift
//
// ActionFooterView.swift
// Alpha
//
// Created by Ian Mendiola on 5/21/20.
// Copyright © 2020 Open Advisers LLC. All rights reserved.
//
import Foundation
import UIKit
@rajuashok
rajuashok / get-form
Created May 5, 2020
CURL applications/get-form
View get-form
curl --request POST \ [ruby-2.6.3p62]
--url https://accounts-api.orbisfn.io/api/applications/get-form \
--header 'authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvYWNjb3VudHMtYXBpLm9yYmlzZm4uaW9cL2FwaVwvYXV0aFwvcmVmcmVzaCIsImlhdCI6MTU4ODIwNTg0NCwiZXhwIjoxNTg4NjgxODE2LCJuYmYiOjE1ODg1OTU0MTYsImp0aSI6ImxKZmhhcnhSTzZhQmx5eFIiLCJzdWIiOjg2MjAsInBydiI6ImYzNzVlYWVkMGM2ZjE2YjJjOWUyYmY1NzE2YzUwMTZiNzUwZjI1NjcifQ.qhTVJKVLUEyRSDtMERnlA1vsgitSALiEjgY1JJw_akg' \
--header 'content-type: application/json' \
--cookie __cfduid=dc65b2cb0e4ddb3615ed1c1d458947ad51587688722 \
--data '{
"with": [
"pages.sections.questions.translations",
"pages.sections.questions.parent_questions.parent_question",
"pages.sections.questions.parent_questions.parent_
@rajuashok
rajuashok / orbis-form.json
Created Mar 26, 2020
Super Abstractions Branch Orbis Application Form
View orbis-form.json
{
"status": true,
"application_type": {
"id": 31,
"pages": [
{
"id": 79,
"position": 1,
"sections": [
{
@rajuashok
rajuashok / portfolio-db-v2.ts
Last active Jan 22, 2020
Portfolio Positions Orders Trades
View portfolio-db-v2.ts
interface Trade {
id: string
security: Security
strategy: Strategy
legs: Legs[]
}
interface TradePosition {
id: string
portfolioId: string
@rajuashok
rajuashok / portfolio-db.ts
Last active Jan 22, 2020
Portfolio Positions Orders Trades
View portfolio-db.ts
interface Trade {
id: string
security: Security
strategy: Strategy
legs: Legs[]
}
interface TradePosition {
id: string
portfolioId?: string // null until order FILLED
@rajuashok
rajuashok / SingleChoiceOnClick.swift
Created Jan 14, 2020
OnClick example for single choice RadioButton group
View SingleChoiceOnClick.swift
func onClick(_ sender: UIView) {
guard let currentRadioButton = sender as? RadioButton else {
return
}
[
radioButton1,
radioButton2
].forEach { $0.isChecked = false } // Set all to unchecked first
currentRadioButton.isChecked = !currentRadioButton.isChecked
@rajuashok
rajuashok / SingleChoiceOnClick.swift
Created Jan 14, 2020
OnClick example for single choice RadioButton group
View SingleChoiceOnClick.swift
func onClick(_ sender: UIView) {
guard let currentRadioButton = sender as? RadioButton else {
return
}
[
radioButton1,
radioButton2
].forEach { $0.isChecked = false } // Set all to unchecked first
currentRadioButton.isChecked = !currentRadioButton.isChecked
@rajuashok
rajuashok / MyViewUsingDefaultRadioButton.swift
Last active Jan 17, 2020
View using DefaultRadioButton
View MyViewUsingDefaultRadioButton.swift
class MyView: UIView, RadioButtonDelegate {
let radioButton = DefaultRadioButton()
override init(frame: CGRect) {
super.init(frame: frame)
radioButton.delegate = self
}
.
.
@rajuashok
rajuashok / MyViewUsingRadioButton.swift
Last active Aug 7, 2020
Example of RadioButton in use
View MyViewUsingRadioButton.swift
class MyView: UIView, RadioButtonDelegate {
let radioButton = RadioButton()
override init(frame: CGRect) {
super.init(frame: frame)
radioButton.delegate = self
radioButton.checkedView = UIImageView.radioOn()
radioBUtton.uncheckedView = UIImageView.radioOff()
}
@rajuashok
rajuashok / DefaultRadioButton.swift
Last active Jan 17, 2020
Product specific extension of RadioButton
View DefaultRadioButton.swift
import UIKit
class DefaultRadioButton: RadioButton {
override init(frame: CGRect) {
super.init(frame: frame)
checkedView = UIImageView.radioOn()
uncheckedView = UIImageView.radioOff()
}
required init?(coder: NSCoder) {