Skip to content

Instantly share code, notes, and snippets.

View atenni's full-sized avatar
🤷‍♂️

Andrew Tennikoff atenni

🤷‍♂️
  • Sydney, Australia
  • 08:44 (UTC +10:00)
View GitHub Profile
@atenni
atenni / AOAI.csv
Last active December 17, 2015 11:48
Financial Indicies
Date AOAI Index
1979-12-31 1000.00
1980-01-31 1174.30
1980-02-29 1214.60
1980-03-31 1040.90
1980-04-30 1079.30
1980-05-31 1214.60
1980-06-30 1286.50
1980-07-31 1305.50
1980-08-31 1355.00
@atenni
atenni / README.md
Last active April 19, 2024 21:48
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@atenni
atenni / Marked Numbered Equations.md
Last active December 17, 2015 11:59
Marked.app header to make MathJax automatically number equations.
XHTML Header: <script type="text/x-mathjax-config">
  MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: "AMS"} } });
</script>

When included as the first line in a Marked document, the following equation will be automatically numbered:

\begin{equation}

E = mc^2

# The four main financial journals
* Journal of finance
* Review of financial studies
* Journal of financial economics
* Journal of financial and quantitative analysis
@atenni
atenni / Archive Moodle Logs.md
Last active June 7, 2017 08:17
Script to archive moodle logs to a separate stats server for future long time series/big data analysis.

Archiving mdl_log, daily

(From http://www.ualberta.ca/~dostatni/moodlemoot2013/mdl_log.html)

The following script is executed daily. It generates a CSV file with all the moodle activity for previous day. That file is saved together with apache access and error logs in a log server. This data is used to verify student challenges ( eg. "I couldn't submit my assignment because there was a problem with the system"), identify trends and trace the origin of errors (to a specific code deployment).

This level of archiving allows us to remove the mdl_log entries from the active database. Currently the logs take up about half of the size of the database on disk.

dump_yesterdays_logs.sql

ASX200 Close
17/10/2001 3249.6
1/11/2001 3337.5
3/12/2001 3422.3
2/01/2002 3464.2
1/02/2002 3414.3
1/03/2002 3414.8
2/04/2002 3350
1/05/2002 3373.6
3/06/2002 3216
@atenni
atenni / Financial Indicators - Monthly.csv
Last active December 23, 2015 02:29
Includes: S&P/ASX 200, AOAI, Dividend yield, ASX P/E ratio, Domestic market cap, Interbank cash rate, 2yr bonds, 3yr bonds, 5yr bonds, 10yr bonds
ASX200 Close AOAI Index Dividend yield ASX P/E ratio Domestic market cap ($m) Interbank cash rate 2yr Bond 3yr Bond 5yr Bond 10yr Bond
31/12/79 1000 9.50 10.02 10.08
31/01/80 1174.3 9.24 10.42 10.45
29/02/80 1214.6 8.86 10.90 10.55
31/03/80 1040.9 10.40 11.20 11.20
30/04/80 1079.3 10.68 11.45 11.73
31/05/80 1214.6 13.72 11.80 11.78
30/06/80 1286.5 13.73 11.78 11.76
31/07/80 1305.5 12.86 11.78 11.78
31/08/80 1355 12.42 11.78 11.82
@atenni
atenni / readme.md
Last active August 29, 2015 14:01
Strategy vs Planning

Strategy vs Planning

Strategy is not planning…

Strategy is an integrated set of choices that determine where a firm should play and how it should win there.

– Roger Martin, Playing to win.

| Strategy | Planning |

Create Postgres dev environment in Windows 7 for Django

Install Postgres

  1. Download and run the Postgres Windows installer http://www.postgresql.org/download/windows/
  2. Initally the only user will be postgres. Edit the pg_hba.conf file (probably in C:\Program Files (x86)\PostgreSQL\8.4\data) to add trust to all the methods
  3. Additionally, add local all all trust to the top row to allow localhost access.
  4. Use createuser (in C:\Program Files (x86)\PostgreSQL\8.4\bin) to create a new database (super)user
@atenni
atenni / link_checker.py
Last active October 25, 2017 21:52
A dirty script to spider a base url, iterate over internal link and store the response code and url in link_checker_results.csv. Mainly used for testing.