Skip to content

Instantly share code, notes, and snippets.

View korayguclu's full-sized avatar

Koray Güclü korayguclu

View GitHub Profile
@korayguclu
korayguclu / Http.js
Created May 11, 2018 16:39 — forked from dbshoupe/Http.js
Wrapper class for Axios in a Vue project that uses interceptor to inject token (stored using Vuex) into header for each request.
import axios from 'axios';
import store from "@/data/state"
class Http {
constructor() {
let service = axios.create({});
service.interceptors.request.use((config) => {
config.headers.common['x-access-token'] = store.state.token
return config
@korayguclu
korayguclu / ultimate-ut-cheat-sheet.md
Created April 11, 2018 12:20 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@korayguclu
korayguclu / tmux.md
Created April 5, 2018 08:33 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

Create a simple nodejs hello world application

Add following Dockerfile

FROM node:8.10-alpine

MAINTAINER Koray Güclü

COPY . /var/www
@korayguclu
korayguclu / vagrant-box-config-for-development.md
Last active April 14, 2018 09:46
How to configure development VM Box

Xubuntu VM Development Machine

Packages to install

Install OhMyZH as described here

Install silversearcher ag apt-get install silversearcher-ag

Install Mitmproxy by using this binary

@korayguclu
korayguclu / axios-vs-superagent.js
Created February 7, 2018 11:59 — forked from natesilva/axios-vs-superagent.js
Compare performance of Axios vs. SuperAgent when running under Node.js
const Benchmark = require('benchmark');
const axios = require('axios');
const superagent = require('superagent');
var suite = new Benchmark.Suite;
const targetUrl = 'http://httpbin.org/ip';
suite
.add('axios', {
@korayguclu
korayguclu / docker-cheat-sheat.md
Created January 31, 2018 21:18 — forked from dwilkie/docker-cheat-sheat.md
Docker Cheat Sheet

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@korayguclu
korayguclu / pyenv-installation.md
Created July 20, 2017 20:27
pyenv insallation

pyenv installation

pyenv installation on macos

$ brew update
$ brew install pyenv

~$ pyenv global

system

@korayguclu
korayguclu / clone-website-with-wget.sh
Created June 24, 2017 09:00
Clone a Remote website with wget
wget -U "Mozilla/5.0 (X11; U; Linux; en-US; rv:1.9.1.16) Gecko/20110929 Firefox/3.5.16" --recursive --level=1 --no-clobber --page-requisites --html-extension --convert-links --no-parent --wait=3 --random-wait http://www.example.com/docs/interesting-part/ --domains=www.example.com
@korayguclu
korayguclu / gist:0ca11b8120645f37633bd5c16e5328f0
Last active December 19, 2016 22:04
Metastock for Autoenvelopes as discussed in Alexander Elder's books
Below is formula in Metastock for Autoenvelopes as discussed in Alexander Elder's books. Is it possible to convert them to bullscript?
thanks
Got this MS formula for the same thing from another web source. The parameters of this
look more closer to description in the book
EMA:=input("Base EMA", 22, 1, 100);
Factor:=input("Factor", 27, 1, 50);
avg:=ma(C,EMA,E);
csize:= Stdev(2*Max(Abs(H-avg) ,Abs(L-avg)) / avg,100)*Factor/10; {Use 100 days for stable channel size - default is 2.7 std}