Skip to content

Instantly share code, notes, and snippets.

View schinsue's full-sized avatar

Sergio Chin-Sue schinsue

View GitHub Profile

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@abelardojarab
abelardojarab / zenbot_strategy.md
Last active January 29, 2023 18:20
zenbot strategy

Current strategy

$  ./zenbot.sh trade gdax.eth-USD --trend_ema 20 -period 7m --max_slippage_pct 0.48 --poll_trades 6000 --order_poll_time 6000 --order_adjust_time 6000 --oversold_rsi_periods=1000 --oversold_rsi=1000 --rsi_periods=1100 --neutral_rate=0.1 --max_sell_loss_pct=0.85 --max_buy_loss_pct=5 --buy_pct=100 --sell_pct=100 --selector gdax.eth-usd  --markup_sell_pct 0.25  --markdown_buy_pct 0.00  --reset-profit

The role of buy & sell percentages (PCT)

@nikneroz
nikneroz / Guardian JWT.md
Last active October 10, 2023 19:13
Elixir + Phoenix Framework + Guardian + JWT. This is tutorial and step by step installation guide.

Elixir + Phoenix Framework + Guardian + JWT + Comeonin

Preparing environment

We need to generate secret key for development environment.

mix phoenix.gen.secret
# ednkXywWll1d2svDEpbA39R5kfkc9l96j0+u7A8MgKM+pbwbeDsuYB8MP2WUW1hf

Let's generate User model and controller.

@qertoip
qertoip / sliding_session_timeout.ex
Last active July 18, 2023 15:33
Elixir / Phoenix Sliding Session Timeout Plug
# How to use it:
#
# Plug it at the end of your :browser pipeline in your Phoenix app router.ex
# Make sure it is plugged before your session-based authentication and authorization Plugs.
#
# pipeline :browser do
# plug :accepts, ["html"]
# plug :fetch_session
# plug :fetch_flash
# plug :put_secure_browser_headers
@androidfred
androidfred / haskell_stack_and_intellij_idea_ide_setup_tutorial_how_to_get_started.md
Last active February 4, 2024 20:58
Haskell, Stack and Intellij IDEA IDE setup tutorial how to get started

Haskell, Stack and Intellij IDEA IDE setup tutorial how to get started

Upon completion you will have a sane, productive Haskell environment adhering to best practices.

Basics

  • Haskell is a programming language.
  • Stack is tool for Haskell projects. (similar tools for other languages include Maven, Gradle, npm, RubyGems etc)
  • Intellij IDEA IDE is a popular IDE.

Install required libraries

sudo apt-get install libtinfo-dev libghc-zlib-dev libghc-zlib-bindings-dev

Deploying Elixir and Phoenix applications using Docker and Exrm

Goal

By the end of this quick guide, you will know how to compile a Phoenix app release using Exrm and run it inside a Docker container. I've found only a couple of articles that discuss getting an Elixir app up and running inside a Docker container, and even those only touched on some parts of the process. The idea is that this guide will give you a full end-to-end example of how to get all the pieces and parts working together so that you are able to deploy your Phoenix application inside a Docker container.

Assumptions

  1. You already have a working Elixir environment with the Phoenix Framework installed
  2. You have at least basic working knowledge of Docker, and have installed the Docker tools onto your local environment
@patik
patik / how-to-squash-commits-in-git.md
Last active October 17, 2023 02:19
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE