Skip to content

Instantly share code, notes, and snippets.

Avatar
💪
Grinding

Jamone Kelly Jamonek

💪
Grinding
View GitHub Profile
View forex_trader.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy
import pandas
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
# Scikit's LinearRegression model
from sklearn.linear_model import LinearRegression
from scipy import stats
import math
@Jamonek
Jamonek / Robinhood.py
Created Apr 17, 2018
Robinhood merge conflicts
View Robinhood.py
<<<<<<< master
##############################
#GET OPEN ORDER(S)
##############################
def get_open_orders(self):
"""
Returns all currently open (cancellable) orders.
If not orders are currently open, `None` is returned.
View TabController.swift
//
// TabController.swift
// School For Me
//
// Created by Jamone Alexander Kelly on 2/14/16.
// Copyright © 2016 Jamone Kelly. All rights reserved.
//
import UIKit
import FontAwesomeKit
View operators.swift
postfix operator ++ {}
postfix func ++(inout value: Int) -> Int {
value += 1
return value
}
postfix operator -- {}
postfix func --(inout value: Int) -> Int {
value -= 1
return value
View haversine.swift
// The fixed formula
struct Global {
static var schoolID: Int? // Work around for passing the selected location ID
static var userCoord: CLLocationCoordinate2D?
func computeDistance() -> Double {
// User coordinate
let uLat: Double = 35.6603676639829
let uLng: Double = -80.4443005566303
// School coordinate
View ugly-view-creation.swift
// I know this is horrible lol I needed a quick hacky way to create the blurred view with data
// lil bit of number magic :o
// definitely a better way to do this lol I'll come back to it as well
schoolNameLabel.frame = CGRect(x: sX*0.22, y: sY * 0.1, width: 15, height: 20)
schoolNameLabel.sizeToFit()
schoolNameLabel.textColor = UIColor.grayColor()
specialView.addSubview(schoolNameLabel)
schoolNameLabelContent.frame = CGRect(x: sX*0.4, y: sY*0.1, width: 15, height: 20)
schoolNameLabelContent.sizeToFit()
View toAttributedStringExt.swift
import UIKit
extension String {
func toAttributedString(font font:UIFont!, kerning: CGFloat!, color:UIColor!) -> NSAttributedString {
return NSAttributedString(string: self as String, font: font, kerning: kerning, color: color)!
}
}
View AlertExt.swift
import UIKit
extension UIViewController {
func alert(title: String = "", message: String, actionTitle:String = "OK") {
let alertController = UIAlertController(title: title, message: message, preferredStyle: .Alert)
let OKAction = UIAlertAction(title: actionTitle, style: .Default, handler: nil)
alertController.addAction(OKAction)
self.presentViewController(alertController, animated: true, completion: nil)
}
}
@Jamonek
Jamonek / chomp.swift
Created Nov 20, 2015
String extension to remove first character of a string in swift.
View chomp.swift
extension String {
var chomp : String {
mutating get {
self.removeAtIndex(self.startIndex)
return self
}
}
}
var test : String = "Chomp"
@Jamonek
Jamonek / MapVC.swift
Created Mar 24, 2015
Swift calling showRadiusKeyConstant before getCloseLocations()
View MapVC.swift
dispatch_async(dispatch_get_main_queue()) {
if((self.defaults.valueForKey(self.facilityBoolKeyConstant) as Bool) != false) {
self.getCloseLocations("fc")
}
if((self.defaults.valueForKey(self.medicareBoolKeyConstant) as Bool) != false) {
self.getCloseLocations("md")
}
if((self.defaults.valueForKey(self.vaHospitalBoolKeyConstant) as Bool) != false) {
self.getCloseLocations("vh")
}