Skip to content

Instantly share code, notes, and snippets.

View aitoroses's full-sized avatar

Aitor Oses aitoroses

View GitHub Profile
@khalidsalomao
khalidsalomao / tradingview-strategy-backtester-boilerplate.pine
Last active July 31, 2021 15:08
A simple template for backtesting a trading view pine strategy
//@version=3
// TODO: update strategy name
strategy("{STRATEGY NAME}", overlay=true)
// === TA LOGIC ===
//
//
// TODO: PUT YOUR TA LOGIC HERE
LONG_SIGNAL_BOOLEAN = crossover(sma(close, 13), sma(close, 34))
@gvolpe
gvolpe / di-in-fp.md
Last active April 24, 2024 20:51
Dependency Injection in Functional Programming

Dependency Injection in Functional Programming

There exist several DI frameworks / libraries in the Scala ecosystem. But the more functional code you write the more you'll realize there's no need to use any of them.

A few of the most claimed benefits are the following:

  • Dependency Injection.
  • Life cycle management.
  • Dependency graph rewriting.
@imranismail
imranismail / queue.ex
Created April 10, 2017 08:24
Elixir Wrapper for Erlang Queue module
defmodule Queue do
def insert(queue, item), do: :queue.in(item, queue)
def insert_last(queue, item), do: :queue.in_r(item, queue)
def member?(queue, item), do: :queue.member(item, queue)
def filter(queue, fun), do: :queue.filter(fun, queue)
def split(queue, n) do
@askilondz
askilondz / gistlog.yml
Last active April 2, 2024 10:44
Adaptive Streaming with MPEG-DASH and HLS using AWS

Adaptive Streaming has become the neccessity for streaming video and audio. Unfortantely, as of this post, there isn't a whole lot of tutorials that accumulate all of the steps to get this working. Hopefully this post achieves that. This post focuses on using Amazon Web Services (AWS) to transcode for HLS and DASH and be the Content Delivery Network (CDN) that delivers the stream to your web page. We'll be using Video.js for the HTML5 player as well as javascript support libaries to make Video.js work with HLS and DASH.

So Here's what you need:

Set up three S3 buckets

anonymous
anonymous / spacemacs
Created June 7, 2016 12:58
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@aitoroses
aitoroses / . ES6 & JSX & Webpack.md
Last active August 29, 2015 14:19
Project Manifest file examples

Project files

@tkafka
tkafka / LICENSE.txt
Last active September 5, 2019 13:38
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@danharper
danharper / background.js
Last active March 30, 2024 18:25
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@bhameyie
bhameyie / Build.scala
Last active January 12, 2018 14:45
Casbah tutorial (sort of)
// Add salat and casbah to your build.scala or build.sbt files.
object ElBuild extends Build {
val Organization = "your own"
val Version = "0.0.1-SNAPSHOT"
val ScalaVersion = "2.10.3"
val ScalatraVersion = "2.2.1"
resolvers += "Maven Central Server" at "http://repo1.maven.org/maven2"
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"