Skip to content

Instantly share code, notes, and snippets.

View xchehub's full-sized avatar
:octocat:

XC xchehub

:octocat:
View GitHub Profile
@janeshdev
janeshdev / read_multiple_files.R
Last active August 24, 2016 20:23
Read multiple csv files in R #csv #multiple #files
# Import files under folder name fawn
# It is very important to include the option (full.names=TRUE). It it is not included
# then you will get the error something like
# "Error in file(file, "rt") : cannot open the connection In addition: Warning message:
#In file(file, "rt") : cannot open file 'FAWN_2002.csv': No such file or directory
mydata=ldply(list.files(path="data/fawn/",pattern="csv",full.names=TRUE),function(filename) {
dum=read.csv(filename)
dum$filename=filename
return(dum)
library(quantstrat)
library(magrittr)
Xt = getSymbols('2498.TW', auto.assign = F)
# 1st Step: Attach MA indicators onto symbol
Xt$MA5 = Xt %>% Cl %>% SMA(5)
Xt$MA60 = Xt %>% Cl %>% SMA(60)
@rawsushi
rawsushi / Parker Rawsushi ETH overview.txt
Last active September 25, 2017 08:41
Parker ETHEREUM Info Overview
This page is found here -- > http://gg.gg/helpeth <-- Tell Others about it
Created / Supported by: Parker https://gist.github.com/rawsushi/
GPU hw review http://62.212.74.86/~mining/list/index.php
WeChat a) Download Wechat at www.WeChat.com (it's FREE) b) create your new user (it's FREE) c) add WeChat user "PAFwork" (it's FREE)
GITHUB.com - has TONS of great info. Go there and register. It's FREE
Gitter.im - you need Github to log in ...
import Data.List
import Data.Function
import Control.Monad
groupOn f = groupBy ((==) `on` f) . sortBy (compare `on` f)
uniq = map (!! 0) . groupOn id
-- 场景:假设a得到了数字x,b得到了数字y
-- 可看做二分图,其中possibleX,possibleY是顶点,possible是边,(aGuessY x)和(bGuessX y)分别表达x点和y点的邻接点集
possibleX = [4..198]

Aws Elasticsearch Service 踩雷紀錄

前言

本文是為了幫助那些想使用 Aws Elasticsearch Servcie 跟 想使用 logstash kibana 所誕生的。

為何要使用 Aws Elasticsearch Service

免費 是最重要的原因,對於一個缺錢的新創或者是工程師,免費超吸引人的。 安裝快速,擴展方便也很重要,不過都比不過 免費

#-*- coding:utf-8 -*-
#!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
import re
import shutil
import os
out='/home/coericnb'
@lancelakey
lancelakey / gist:3573faa050a122cc6693
Last active September 19, 2018 06:29
AWS CloudWatch custom metrics
### AWS scripts
These look trivial
http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/mon-scripts-perl.html
http://aws.amazon.com/code/8720044071969977
### Diamond
Diamond is fairly popular and it looks like there's a built in way for Diamond to send metrics to AWS CloudWatch so maybe this is fairly easy
https://github.com/BrightcoveOS/Diamond
https://github.com/BrightcoveOS/Diamond/wiki/handler-cloudwatchHandler
@danny0838
danny0838 / .gitconfig
Last active June 23, 2020 22:57
實用的 Git 配置值
[core]
quotepath = false # 中文檔名如實顯示而不轉碼
autocrlf = false # commit 及 checkout 時不根據作業系統轉換檔案的換行字元 (避免不小心改動原 repo 的換行字元)
safecrlf = false # 檢查文字類檔案是否混合了 CRLF 及 LF 換行字元 (搭配 autocrlf,這裡一起關閉)
ignorecase = false # 檔名大小寫不同時視為相異 (更動大小寫才能 commit)
whitespace = cr-at-eol # diff 時行尾 CRLF 不顯示 ^M
fileMode = false # 忽略檔案的 x 屬性 (for Windows)
symlinks = false # 忽略符號連結 (for Windows)
editor = /usr/bin/vim # 預設的文字編輯器 (for Linux)
[alias]
@r10r
r10r / gist:2305091
Created April 4, 2012 19:49
embed SWT widget into Swing JFrame
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Dimension;
import javax.swing.JFrame;
import javax.swing.JPanel;
import org.eclipse.swt.SWT;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.swt.browser.Browser;
@creaktive
creaktive / mojo-crawler.pl
Last active November 28, 2020 13:15
Simple web crawler/scraper implemented using Mojolicious
#!/usr/bin/env perl
use 5.010;
use open qw(:locale);
use strict;
use utf8;
use warnings qw(all);
use Mojo::UserAgent;
# FIFO queue