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
@bzerangue
bzerangue / json-to-ndjson.md
Last active January 31, 2024 20:57
JSON to NDJSON

NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.

  • Each line is a valid JSON value
  • Line separator is ‘\n’

1. Convert JSON to NDJSON?

cat test.json | jq -c '.[]' > testNDJSON.json
@nicks9188
nicks9188 / LC_CTYPE.md
Created May 6, 2019 13:51
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
  1. vi /etc/environment

add these lines...

LANG=en_US.utf-8
LC_ALL=en_US.utf-8

Alternatively,

@sarfarazansari
sarfarazansari / nodejs_aws_s3_file_upload.js
Last active March 15, 2024 09:40
How to upload files to AWS S3 with NodeJS - AWS-SDK? With the help of this library you can upload any kind of file to s3. (NODEJS, AWS-SDK, S3)
/**
* we are going to upload file to s3 via node js by using
* aws-sdk - required
* busboy - required
* uuid - optional - for image renaming purpose
* with this library you can upload any kind of file to s3 via node js.
*/
const AWS = require('aws-sdk');
const UUID = require('uuid/v4');
@imtaehyun
imtaehyun / technical-analysis-indicators-without-talib-code.py
Last active May 4, 2024 15:36
Technical analysis Indicators without Talib (code)
# 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)
@rkasigi
rkasigi / osx-random-string.txt
Last active February 5, 2024 16:39
OSX Generate Random String
openssl rand -base64 6
openssl rand -hex 4
openssl rand -base64 8 | md5 | head -c8;echo
openssl rand -base64 6
ping -c 1 yahoo.com |md5 | head -c8; echo
@dongjinleekr
dongjinleekr / consumer.sh
Last active March 25, 2024 03:00
Kafka benchmark commands
## Consumer Throughput: Single consumer thread, no compression
## Consumer Throughput: 3 consumer thread, no compression
bin/kafka-consumer-perf-test.sh --topic benchmark-3-3-none \
--zookeeper kafka-zk-1:2181,kafka-zk-2:2181,kafka-zk-3:2181 \
--messages 15000000 \
--threads 1
<html>
<head>
<title>API Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var accessToken = "<your agent's client access token>";
var baseUrl = "https://api.api.ai/v1/";
@ssmereka
ssmereka / README.md
Last active May 27, 2021 14:47
Installing Cassandra on Mac: A Quick Guide

Install Cassandra on Mac

  1. Install most recent version of Java. Install homebrew if you don't already have it.

    brew install java
    
  2. Grab a link to the most recent version of Cassandra from their download page.

@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
Steps to Install Oracle Instant client and cx_Oracle on Fedora/CentOS/RHEL
1) Download Instant client from oracle website
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
e.g. for Linux 86_64
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Download
1) oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm