Skip to content

Instantly share code, notes, and snippets.

View hbinduni's full-sized avatar
🎯
Focusing

Heriyanto Binduni hbinduni

🎯
Focusing
  • Jakarta, Indonesia
View GitHub Profile
# https://www.quantopian.com/posts/technical-analysis-indicators-without-talib-code
import numpy
import pandas as pd
import math as m
#Moving Average
def MA(df, n):
MA = pd.Series(pd.rolling_mean(df['Close'], n), name = 'MA_' + str(n))
df = df.join(MA)
@hbinduni
hbinduni / redis-subscribe-stream.js
Created March 13, 2021 23:47
Redis publish and subscribe to stream
const redis = require('redis');
const {promisify} = require('util');
const waitFor = (ms) => new Promise((r) => setTimeout(r, ms));
const host = 'localhost';
const port = 6379;
const password = 'xxxxx-xx-xxxx';
const options = {host, port, password};
@hbinduni
hbinduni / beforeSaveService.spec
Created February 10, 2018 01:04 — forked from mmazzarolo/beforeSaveService.spec
Parse-server setup
import Parse from 'parse/node'
import { afterEach, describe, it } from 'mocha'
import chai from 'chai'
import chaiAsPromised from 'chai-as-promised'
import { resetParse, getAdminUser } from '../../../test/parseHelper'
import errors from '../../utils/errors'
chai.use(chaiAsPromised)
const assert = chai.assert
@hbinduni
hbinduni / async-await.js
Created February 10, 2018 01:04 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@hbinduni
hbinduni / install_tesseract.sh
Created September 22, 2017 02:12 — forked from fractaledmind/install_tesseract.sh
install tesseract-ocr on a Mac
#!/usr/bin/env bash
# courtesy of : <https://ryanfb.github.io/etc/2014/11/13/command_line_ocr_on_mac_os_x.html>
# Check for Homebrew,
# Install if we don't have it
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Ensure `homebrew` is up-to-date and ready