Skip to content

Instantly share code, notes, and snippets.

@oliveagle
oliveagle / spy-trades.csv
Created August 1, 2022 14:25
simple-spy-trades-examples
Symbol Trade Date Price Ex. date Ex. Price % chg Profit % Profit Cum. Profit # bars
SPY Long 2/16/1993 25.1507 2/18/1993 25.1145 -0.14% -9.4 -0.19% -9.4 3
SPY Long 4/2/1993 25.6326 4/12/1993 26.1049 1.84% 89.92 1.80% 80.52 6
SPY Long 4/22/1993 25.5418 4/27/1993 25.5054 -0.14% -9.33 -0.19% 71.19 4
SPY Long 6/8/1993 25.9959 6/11/1993 26.2139 0.84% 39.76 0.79% 110.95 4
SPY Long 6/23/1993 25.8869 6/24/1993 26.2345 1.34% 65.01 1.30% 175.96 2
SPY Long 7/6/1993 25.8869 7/8/1993 26.2528 1.41% 68.6 1.37% 244.56 3
SPY Long 7/22/1993 26.0516 7/23/1993 26.1796 0.49% 22.43 0.45% 266.99 2
SPY Long 11/4/1993 27.0047 11/5/1993 27.1336 0.48% 21.73 0.43% 288.72 2
SPY Long 1/3/1994 27.5598 1/4/1994 27.671 0.40% 18.03 0.36% 306.75 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oliveagle
oliveagle / 20130416-todo.md
Created November 30, 2015 07:36 — forked from mrflip/20130416-todo.md
Elasticsearch Tuning Plan

Next Steps

  • Measure time spend on index, flush, refresh, merge, query, etc. (TD - done)
  • Take hot threads snapshots under read+write, read-only, write-only (TD - done)
  • Adjust refresh time to 10s (from 1s) and see how load changes (TD)
  • Measure time of a rolling restart doing disable_flush and disable_recovery (TD)
  • Specify routing on query -- make it choose same node for each shard each time (MD)
  • GC new generation size (TD)
  • Warmers
  • measure before/after of client query time with and without warmers (MD)
@oliveagle
oliveagle / awk_example.sh
Created May 28, 2015 15:17
some linux command tips
# 统计nginx日志不同ip的访问次数
awk '{print $1}' access.log | sort | uniq -c
# 统计nginx 日志有多少个不同的ip访问
awk '{print $1}' access.log | sort -u
# skip first line
awk 'NR>1 {PRINT $1}'
@oliveagle
oliveagle / curl_iplist.sh
Created May 28, 2015 13:26
curl_iplist.sh
#! /bin/bash
#
# curl_iplist.sh
# Copyright (C) 2015 oliveagle <[email protected]>
#
# Distributed under terms of the MIT license.
#
if [ "$#" -ne 1 ]; then
echo "curl_iplist.sh iplist.txt"
@oliveagle
oliveagle / docker_cmd_proxy_win.py
Created April 3, 2015 03:26
docker command proxy for windows/cygwin
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2015 oliveagle <[email protected]>
#
# Distributed under terms of the MIT license.
#
# File: docker_cmd_proxy_win.py
# Date: 2015-04-02 18:37

How to build Golang windows/arm static binaries from linux

After fumbling around trying to figure out the go toolchain and cross compilation configuration, I ran across the wiki page on Go's homepage. It's super helpful, and worked out of the box. I'm including the necessary scripts here in case they get changed or lost, and we can help Google find it (since it's the first real source I've found that "Just Worked"). http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling

I also went a step further, and built for windows/amd64 and linux/arm

func readLine(path string) {
inFile, _ := os.Open(path)
defer inFile.Close()
scanner := bufio.NewScanner(inFile)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
fmt.Println(scanner.Text())
}
}
angular.module('testApp', []).
directive('lazyLoad', ['$window', '$q', function ($window, $q) {
function load_script() {
var s = document.createElement('script'); // use global document since Angular's $document is weak
s.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize';
document.body.appendChild(s);
}
function lazyLoadApi(key) {
var deferred = $q.defer();
$window.initialize = function () {