Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"log"
"net/http"
"os/exec"
)
func metrics(w http.ResponseWriter, req *http.Request) {
package main
import (
"bytes"
"errors"
"fmt"
"log"
"net"
"os"
"os/signal"
package main
import (
"fmt"
"net/http"
"time"
"github.com/dghubble/go-twitter/twitter"
"github.com/dghubble/oauth1"
)
import { Client } from ".";
const client = new Client("ws://localhost:2560");
(async () => {
try {
const room = await client.joinOrCreate<any>("ffa");
console.log("joined successfully", room.sessionId);
import kotlin.reflect.jvm.jvmErasure
import kotlin.reflect.typeOf
class Y
class X<T>
@OptIn(ExperimentalStdlibApi::class)
inline fun <reified T> T.getGenericType(): Class<Any>? = typeOf<T>().arguments[0].type?.jvmErasure?.java as Class<Any>?
package io.colyseus.example.java;
import io.colyseus.Client;
import io.colyseus.Room;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import org.jetbrains.annotations.NotNull;
public class Main {
//@version=4
study("Weighted SMA")
weighted_sma(price, length) =>
totalWeight = log(length)
totalMA = log(length) * price
for i = 1 to length-1
totalWeight := totalWeight + log(length - i)
currentMA = log(length - i) * sma(price, i)
totalMA := totalMA + currentMA
totalMA / totalWeight
//@version=2
// author: Milad Doorbash
strategy("Bitfinex Greed Level + RSI Strategy")
sym = input(title="Symbol", defval="BTCUSD", type=string)
greedChange = input(0.4, title="Greed Change")
greedLength = input(100, title="Greed SMA Length")
rsiHigh = input(70, title="RSI High")
rsiLow = input(30, title="RSI Low")
@doorbash
doorbash / db.json
Last active February 19, 2021 02:27
Buy new pair once added to Binance (Experimental)
{
"pairs": [
{
"symbol": "BNBBUSD",
"price": "206.50010000"
},
{
"symbol": "BTCBUSD",
"price": "51875.51000000"
},
@doorbash
doorbash / index.js
Last active February 19, 2021 06:26
const Binance = require('node-binance-api');
const binance = new Binance().options({
APIKEY: '***',
APISECRET: '***'
});
const low = require('lowdb')
const FileSync = require('lowdb/adapters/FileSync')