Skip to content

Instantly share code, notes, and snippets.

/*
A single-file JavaScript class to draw candlestick charts.
Use at your own risk.
https://twitter.com/pingpoli
https://pingpoli.de
*/
function pingpoliCandlestick( timestamp , open , close , high , low )
{
this.timestamp = parseInt(timestamp);
this.open = parseFloat(open);
@valmat
valmat / proxy.md
Created April 14, 2018 08:34
proxy

Проверено на 5 баксовом тарифе DigitalOcean


Создаём proxy пользователя для аутентификации по паролю:

useradd -d /dev/null teleg
passwd teleg
@xaota
xaota / line-reader-promise.js
Created January 11, 2018 09:01
чтение из файла / потока в синхронном треде
#!/usr/local/bin/node --max_old_space_size=1024
"use strict";
const fs = require('fs');
/* eslint-disable */
class StreamBuffer {
constructor() {
this.blocks = [];
@asimshankar
asimshankar / README.md
Last active January 28, 2024 17:24
Training TensorFlow models in C++

Training TensorFlow models in C++

Python is the primary language in which TensorFlow models are typically developed and trained. TensorFlow does have bindings for other programming languages. These bindings have the low-level primitives that are required to build a more complete API, however, lack much of the higher-level API richness of the Python bindings, particularly for defining the model structure.

This file demonstrates taking a model (a TensorFlow graph) created by a Python program and running the training loop in C++.

@natanaeljr
natanaeljr / GenericMakefile.mk
Last active August 11, 2023 22:43
Simple generic makefile example to start a project quickly. Can: select C or C++ compiler automatically, identify multiple extentions, detect auto-dependencies and compile modified files only, etc. Various modifiable settings.
PROJECT := $(notdir $(CURDIR))
EXCECUTABLE = $(BUILDDIR)/$(PROJECT)
# Directories specification
SRCDIRS := src
INCDIRS := include
BUILDDIR := build
# @note: to add another source extension, add to herer AND make sure to
# write the " $(BUILDDIR)/%.o: %.ext " rule for this extention in order to work
@krshock
krshock / logger.d
Last active December 25, 2018 15:17
A basic @nogc alternative to writeln for Dlang
module logger;
/*
- Supported types: string, int, float, bool
- License CC0, URL: https://creativecommons.org/publicdomain/zero/1.0/
Using logger.d:
-------------------
import logger;
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 30, 2024 23:36
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@kristopherjohnson
kristopherjohnson / formatjson.js
Last active November 29, 2023 02:47
Read JSON from standard input and writes formatted JSON to standard output. Requires Node.js.
#!/usr/bin/env node
// Reads JSON from stdin and writes equivalent
// nicely-formatted JSON to stdout.
var stdin = process.stdin,
stdout = process.stdout,
inputChunks = [];
stdin.resume();
@9rnsr
9rnsr / gist:4152297
Last active June 13, 2019 06:24
isType, isFunction, isPropertyFunction, isVariable, isEnum, isFinal
import std.traits;
/**
* Detect whether $(D X) is a type or not.
*/
template isType(X...) if (X.length == 1)
{
enum isType = is(X[0]);
}