Skip to content

Instantly share code, notes, and snippets.

View rnikitin's full-sized avatar

Roman Nikitin rnikitin

View GitHub Profile
@rnikitin
rnikitin / btop_setup.sh
Created March 13, 2024 21:30
Setup latest btop on ubuntu
cd /tmp
wget https://github.com/aristocratos/btop/releases/download/v1.3.2/btop-x86_64-linux-musl.tbz
tar -xvjf btop-x86_64-linux-musl.tbz
cd btop/
# use "make install PREFIX=/target/dir" to set target, default: /usr/local
# only use "sudo" when installing to a NON user owned directory
sudo make install
# run after make install and use same PREFIX if any was used at install
# set SU_USER and SU_GROUP to select user and group, default is root:root
sudo make setuid
@rnikitin
rnikitin / Optimize-NSGAII.py
Created January 16, 2022 21:35 — forked from ysdede/Optimize-NSGAII.py
Multi-objective NSGAII hyperparameters optimization with Optuna
import json
import signal
import sys
from subprocess import PIPE, Popen, call
import jessetk.utils as utils
import optuna
# Multi-objective NSGAII hyperparameters optimization with Optuna
# Wraps Jesse ai's backtest function as an objective function
@rnikitin
rnikitin / Pick-Parameters.py
Created January 15, 2022 23:33 — forked from ysdede/Pick-Parameters.py
Pick best parameters from Optuna database
import optuna
import statistics
import json
# This code snippet filters Optuna trials based on performance metrics and standard deviation
# and generates a results.csv file containing all results
# and a SEQ.py file containing all hyperparameters
study = optuna.create_study(study_name="Band5min-LongOnly", directions=["maximize", "maximize"],
storage="postgresql://optuna_user:optuna_password@localhost/optuna_db_3", load_if_exists=True)
@rnikitin
rnikitin / gist:998d13dd935d581e8016
Created July 8, 2014 16:46
List of all countries with phone codes
[{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
}, {
"name": "Albania",
"dial_code": "+355",
"code": "AL"
}, {
"name": "Algeria",
#!/bin/bash
# ----------------------
# KUDU Deployment Script
# ----------------------
# Helpers
# -------
exitWithMessageOnError () {
<!doctype html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Css3 Fold Effect</title>
@rnikitin
rnikitin / gist:4224556
Created December 6, 2012 13:47
Azure Tables Client 2.0 sucks
public IList<ChatMessageEntry> QueryChatMessages(Guid companyId, Guid? appId = null, Guid? formId = null, Guid? ticketId = null)
{
var chatTable = GetTable(companyId, TABLE_CHAT);
var filters = new List<string>();
if (appId.HasValue)
{
filters.Add(TableQuery.GenerateFilterConditionForGuid("AppId",
QueryComparisons.Equal,
@rnikitin
rnikitin / gist:4224486
Created December 6, 2012 13:36
Linq to Entities Roocks
public virtual ActionResult Form(Guid appID, Guid id)
{
var form = _repo.FormsRepository.Get(id);
var app = _repo.Apps.Get(appID);
if (form.App.Company.ID != CurrentContext.Customer.Company.ID)
throw new HttpException((int)HttpStatusCode.Forbidden, "Not authorized access");
var model = new FormViewModel
{
$(document).ready(function() {
$('.gist').each(function(i) {
writeCapture.html(this, '<script src="'+$(this).text()+'.js"></script>');
});
});
@rnikitin
rnikitin / glyphicons.css
Created August 6, 2012 12:48
Glypth icons css sprite
[class^="glyphicon-"], [class*=" glyphicon-"] {
display: inline-block;
*margin-right: .3em;
line- vertical-align: text-top;
background-image: url("images/glyphicons-2.png");
background-position: 14px 14px;
background-repeat: no-repeat;
width: 14px;
height: 14px;
}