This file contains hidden or 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
{ | |
"editor.fontSize": 14, | |
"editor.fontFamily": "Ricty Diminished", | |
"editor.renderWhitespace": "boundary", | |
"editor.minimap.enabled": true, | |
"editor.renderControlCharacters": false, | |
"editor.suggestSelection": "first", | |
"workbench.startupEditor": "newUntitledFile", | |
"workbench.colorTheme": "Slime", | |
"workbench.iconTheme": "material-icon-theme", |
This file contains hidden or 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
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; | |
ssl_ecdh_curve secp384r1; | |
ssl_session_cache shared:SSL:60m; | |
ssl_session_tickets off; | |
ssl_stapling on; | |
ssl_stapling_verify on; | |
#ssl_session_timeout 5m; |
This file contains hidden or 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
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; |
This file contains hidden or 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
class IndentedLabel: UILabel { | |
override func drawText(in rect: CGRect) { | |
let insets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 0) | |
// let customRect = UIEdgeInsetsInsetRect(rect, insets) Swift 4.0 | |
// Swift 4.2~ | |
let customRect = rect.inset(by: insets) | |
super.drawText(in: customRect) | |
} |
This file contains hidden or 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
// Old Swift ~4.0 | |
let imageData = UIImageJPEGRepresentation(image, 0.8) | |
// New Swift 4.2~ | |
let imageData = image.jpegData(compressionQuality: 0.8) |
This file contains hidden or 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
import numpy as np | |
import pandas as pd | |
# ADX | |
def adx_di(high, low, close, period_di, period_adx): | |
last_close = shift(close, 1, cval=0) | |
last_high = shift(high, 1, cval=0) | |
last_low = shift(low, 1, cval=0) | |
dmp = np.where((high - last_high) < 0, 0, (high - last_high)) |
This file contains hidden or 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
# RCI | |
ord(seq, idx, itv) => | |
p = seq[idx] | |
o = 1 | |
for i = 0 to itv - 1 | |
if p < seq[i] | |
o := o + 1 | |
o | |
d(itv) => |
This file contains hidden or 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
# RCI | |
def RCI(seq, itv): | |
def ord(seq, idx, itv): | |
p = seq[idx] | |
o = 1 | |
for i in range(itv - 1): | |
if p < seq[i]: | |
o += 1 | |
return o |
This file contains hidden or 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
import pandas as pd | |
period = 14 | |
# pandas 0.23.4 | |
df_close.rolling(period).max() | |
df_close.rolling(period).min() | |
df_close.rolling(period).mean() | |
df_close.rolling(period).std() |
This file contains hidden or 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
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443 ssl http2; |
NewerOlder