Skip to content

Instantly share code, notes, and snippets.

View Jamonek's full-sized avatar
🏗️
Building.. Exploring.. Dreaming..

Jamone Kelly Jamonek

🏗️
Building.. Exploring.. Dreaming..
View GitHub Profile
#!/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
// 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
@Jamonek
Jamonek / Robinhood.py
Created April 17, 2018 18:50
Robinhood merge conflicts
<<<<<<< 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.
//
// 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
postfix operator ++ {}
postfix func ++(inout value: Int) -> Int {
value += 1
return value
}
postfix operator -- {}
postfix func --(inout value: Int) -> Int {
value -= 1
return value
// this goes into every page where the hijack will take place
// or where the hijack will land
function hijack (abs, landing) {
// get the #jump=url from the url
url_hash = window.location.hash.substr(1);
// make sure its actually a #jump=
if (url_hash.indexOf("jump=") !== -1) {
// trim off jump= and redirect
url = window.location.hash.substr(6);
window.setTimeout(function(){
// 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()
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)!
}
}
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 November 20, 2015 12:54
String extension to remove first character of a string in swift.
extension String {
var chomp : String {
mutating get {
self.removeAtIndex(self.startIndex)
return self
}
}
}
var test : String = "Chomp"