Skip to content

Instantly share code, notes, and snippets.

@ystrohanov
ystrohanov / Swift4JSONValue.swift
Created January 14, 2020 22:02 — forked from hannesoid/Swift4JSONValue.swift
Decodes an unknown JSON structure using Swift 4 Decoding
import XCTest
// Requires a recent Swift 4 snapshot toolchain (Xcode 9 beta 2 not new enough)
public indirect enum JSONValue: Decodable {
case double(Double)
case string(String)
case bool(Bool)
case dictionary([String: JSONValue])
case array([JSONValue])
//
// ListItem.swift
// FetchRewardsAssignment
//
// Created by Strohanov, Yevhen (Chicago) on 1/14/20.
// Copyright © 2020 Organization. All rights reserved.
//
import Foundation

Open all files with git merge conflicts in editor

git diff --name-only | uniq | xargs vim [subl, code]

alias fix='$EDITOR `git diff --name-only | uniq`'
@ystrohanov
ystrohanov / .bash_profile
Created March 6, 2019 16:13 — forked from cajun-code/.bash_profile
bash profile for rails development
source /usr/local/git/contrib/completion/git-completion.bash
complete -C "/usr/bin/gemedit --complete" gemedit
export WORKON_HOME=~/.env
export JAVA7_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home
export JAVA6_HOME=/Library/Java/Home
export JAVA_HOME=$JAVA6_HOME
export PATH=$JAVA_HOME/bin:$PATH
export SBT_OPTS="-XX:MaxPermSize=256M"
"""
Copyright (C) 2018 Interactive Brokers LLC. All rights reserved. This code is subject to the terms
and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable.
"""
import sys
from ibapi.contract import *
let fontFamilies = UIFont.familyNames
for fontFamily in fontFamilies {
let fontNames = UIFont.fontNames(forFamilyName: fontFamily)
print(fontFamily, fontNames)
}
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
@ystrohanov
ystrohanov / temp.py
Created September 15, 2018 00:49 — forked from robcarver17/temp.py
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway:
@ystrohanov
ystrohanov / temp.py
Created September 11, 2018 01:11 — forked from robcarver17/temp.py
ibAPIexample2.py
# Gist example of IB wrapper ...
#
# Download API from http://interactivebrokers.github.io/#
#
# Install python API code /IBJts/source/pythonclient $ python3 setup.py install
#
# Note: The test cases, and the documentation refer to a python package called IBApi,
# but the actual package is called ibapi. Go figure.
#
# Get the latest version of the gateway: