This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule AcmeUdpLogger.MessageReceiver do | |
use GenServer | |
def start_link(opts \\ []) do | |
GenServer.start_link(__MODULE__, :ok, opts) | |
end | |
def init (:ok) do | |
{:ok, _socket} = :gen_udp.open(21337) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule AcmeUdpLogger.MessageReceiver do | |
use GenServer | |
require Logger | |
def start_link(opts \\ []) do | |
GenServer.start_link(__MODULE__, :ok, opts) | |
end | |
def init (:ok) do | |
{:ok, _socket} = :gen_udp.open(21337) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule AcmeUdpLoggerTest.MessageReceiver do | |
use ExUnit.Case | |
@header <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2>> | |
@priority_code <<81>> | |
@agent_number <<7, 0, 0, 0>> | |
@message <<116, 104, 101, 32, 104, 101, 110, 32, 104, 97, 115, 32, 102, 108, 111, 119, 110, 32, 116, 104, 101, 32, 99, 111, 111, 112, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32>> | |
test "it should extract relevant data from UDP packet" do | |
packet = @header <> @priority_code <> @agent_number <> @message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def application do | |
[mod: {AcmeUdpLogger, []}, | |
applications: [:logger]] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule AcmeUdpLogger do | |
use Application | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
children = [ | |
# We will add our children here later | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am civilframe on github. | |
* I am alexsolo (https://keybase.io/alexsolo) on keybase. | |
* I have a public key ASAnUU5xjdh_Hx5hqv5XdqWhF3FlWUfHoO-0V9h7OIQkFAo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://api.intrinio.com/companies/insider_ownership?identifier=AAPL&api_key={YOUR_API_KEY} | |
{ | |
"data": [ | |
{ | |
"owner_cik": "0001214128", | |
"owner_name": "LEVINSON ARTHUR D", | |
"last_reported_date": "2020-02-04", | |
"value": 345749000, | |
"amount": 1150083 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://api.intrinio.com/companies/insider_transactions?identifier=AAPL&api_key={YOUR_API_KEY} | |
{ | |
"data": [ | |
{ | |
"owner_cik": "0001051401", | |
"owner_name": "JUNG ANDREA", | |
"filing_date": "2020-04-30", | |
"filing_url": "https://www.sec.gov/Archives/edgar/data/320193/000032019320000054/xslF345X03/wf-form4_158829658358801.xml", | |
"director": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################################################################### | |
# Get Historical Insider Ownership for a Company on a Given Date | |
########################################################################### | |
require 'net/http' | |
require 'json' | |
require 'date' | |
#-------------------------------------------------------------------------- | |
# Variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"fundamentals": [ | |
{ | |
"id": "fun_z541aN", | |
"statement_code": "cash_flow_statement", | |
"fiscal_year": 2017, | |
"fiscal_period": "FY", | |
"type": "restated", | |
"start_date": "2016-09-25", | |
"end_date": "2017-09-30", |
OlderNewer