Skip to content

Instantly share code, notes, and snippets.

View IanLeatherbury's full-sized avatar

Ian Leatherbury IanLeatherbury

  • Microsoft
  • San Francisco, CA
View GitHub Profile
#!/bin/bash
# Raycast Script Command Template
#
# Duplicate this file and remove ".template." from the filename to get started.
# See full documentation here: https://github.com/raycast/script-commands
#
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title New Today Doc
@IanLeatherbury
IanLeatherbury / longshort.py
Created May 7, 2019 01:35
L/S Equity algo
import quantopian.algorithm as algo
import quantopian.optimize as opt
from quantopian.pipeline import Pipeline
from quantopian.pipeline.factors import SimpleMovingAverage
from quantopian.pipeline.filters import QTradableStocksUS
from quantopian.pipeline.experimental import risk_loading_pipeline
from quantopian.pipeline.data.psychsignal import stocktwits
from quantopian.pipeline.data import Fundamentals
json_string = '{"first_name": "Ian", "second_name":"Leatherbury"}'
class User(object):
def __init__(self, first_name, second_name):
self.first = first_name
self.second = second_name
# Deserialize
j = json.loads(json_string)
json_string = '{"first_name": "Ian", "second_name":"Leatherbury"}'
class User(object):
def __init__(self, first_name, second_name):
self.first = first_name
self.second = second_name
j = json.loads(json_string)
class ThisIsAToughOne(object):
def __init__(self,
the1: int,
empty: int,
):
self.the1 = the1
self.empty = empty
class FooBla(object):
def __init__(self,
class Pokedex(object):
def __init__(self, pokemon):
self.pokemon = pokemon
class Pokemon(object):
def __init__(self,
prev_evolution="value",
name="",
import json
from QuickType import pokedex_from_json
p = json.loads(open('resources/pokedex.json').read())
dex = pokedex_from_json(p)[0].name
print(dex)
namespace SimulatedDevice
{
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
using Microsoft.Azure.Devices.Client;
/Users/ian/Projects/DocumentDB-Quickstart-Xamarin/packages/Xamarin.Forms.2.3.3.180/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets(3,3): Error MSB4018: The "XamlCTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file "/Users/ian/Projects/DocumentDB-Quickstart-Xamarin/Droid/obj/Debug/DocumentDBTodo.Droid.dll.mdb".
File name: '/Users/ian/Projects/DocumentDB-Quickstart-Xamarin/Droid/obj/Debug/DocumentDBTodo.Droid.dll.mdb'
Server stack trace:
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x00293] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.IO/FileStream.cs:282
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.I
@IanLeatherbury
IanLeatherbury / SPY Stop Loss Strat
Last active January 8, 2017 19:08
SPY Stop Loss Strat
from quantopian.algorithm import attach_pipeline, pipeline_output
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data.builtin import USEquityPricing
from quantopian.pipeline.factors import AverageDollarVolume
from quantopian.pipeline.filters.morningstar import Q500US
from quantopian.pipeline.factors import Returns
from quantopian.pipeline import CustomFactor
def initialize(context):
# Rebalance at the end of every month