Skip to content

Instantly share code, notes, and snippets.

View bluealert's full-sized avatar
🎯
Focusing

Tao bluealert

🎯
Focusing
  • Shanghai, China
View GitHub Profile
@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@kuenishi
kuenishi / beam.rst
Created July 26, 2012 16:22
Erlang BEAM memo

BEAM

assemble

$ erlc -S test.erl
  1. 不要用1分钟图,用5分钟图。
  2. 当你能用一两个setup稳定赚钱之后,尝试增大position而非增加setup来多赚。
  3. 一个bar形成的最后一段时间非常关键,要靠读bar来做交易,一定等bar走完了再下决定。
  4. 怎么学读图?把每张图打印出来,找出机会,看机会附近都发生了什么,几周之后你会对pattern有个感觉。
  5. Signal bar的定义:每个bar 都是潜在的signal bar,但只有看到一个setup bar,下了stop order,且你的单子成交了,那个setup bar才能成为signal bar。
  6. 只把阳线当成做多的signal bar,只把阴线当成做空的signal bar。
  7. One tick trap: 把stop order挂在potential signal bar的上面或下面几个价位,而不只是一个价位。在股票市场上,1个价位的陷阱太常见了。
  8. 有时候一个bar可以既是做多的setup bar也可以是做空的setup bar,你可以在两边都放stop order,一个成交后另一个变成止损单。
  9. Doji bar和反向trend bar作为potential signal bar有更大可能失败,虽然有时候也可以用。一个强trend bar可以给人更多信心,用更大仓位,放更大止损,所以跟着一个strong trend bar进场有更大的可能成功。
  10. 最好的牛市反转bar需要满足多于一个的特征:开在上个bar的收盘附近,收阳,且收得比上个bar的收盘高;下影只有1/3-1/2 bar那么长,上影很小甚至不存在;跟之前一个
@letiemble
letiemble / openssl-maker.sh
Last active April 23, 2023 11:33
A bash script to generate "all-in-one" OpenSSL static libraries for OS X and iOS. The script produces fat static libraries (i386, x86_64 for OS X) and (i386, x86_64, armv7, armv7s, arm64 for iOS) suitable for integration in both OS X and iOS project.
#!/bin/bash
###############################################################################
## ##
## Build and package OpenSSL static libraries for OSX/iOS ##
## ##
## This script is in the public domain. ##
## Creator : Laurent Etiemble ##
## ##
###############################################################################
@sloria
sloria / bobp-python.md
Last active November 14, 2024 15:01
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@arobson
arobson / abstractions.md
Last active October 14, 2021 06:46
Rabbit.MQ + Node.js Notes

Abstraction Suggestions

Summary: use good/established messaging patterns like Enterprise Integration Patterns. Don't make up your own. Don't expose transport implementation details to your application.

Broker

As much as possible, I prefer to hide Rabbit's implementation details from my application. In .Net we have a Broker abstraction that can communicate through a lot of different transports (rabbit just happens to be our preferred one). The broker allows us to expose a very simple API which is basically:

  • publish
  • request
  • start/stop subscription
@spoike
spoike / reflux.js
Created June 29, 2014 22:23
A simpler implementation of React.JS's Flux
var EventEmitter = require('events').EventEmitter,
_ = require('lodash');
/**
* Creates an action functor object
*/
exports.createAction = function() {
var action = new EventEmitter(),
eventLabel = "action",
extension Int {
func bottlesOfBeer() {
let bottles = "\(self) bottle" + (self == 1 ? "" : "s")
let what = " of beer on the wall"
println("\(bottles + what), \(bottles) of beer.")
print("Take one down, pass it around, ")
if self == 1 {
println("no more bottles\(what).")
@soasme
soasme / css-parser.md
Last active August 29, 2015 14:06 — forked from kachayev/css-parser.md
@krongk
krongk / Omniauth_Strategy_Weibo.rb
Last active April 2, 2017 00:28
Omniauth Strategy Weibo 新浪微博Oauth2
#C:\Sites\tm_wed\lib\omniauth\strategies\weibo.rb
# Updated at: 2014-09-04
# Author: [email protected]
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class Weibo < OmniAuth::Strategies::OAuth2