Skip to content

Instantly share code, notes, and snippets.

View YuriyGuts's full-sized avatar

Yuriy Guts YuriyGuts

View GitHub Profile
@YuriyGuts
YuriyGuts / DataRobotV2ApiAutopilotDemo.cs
Created June 22, 2018 23:37
C# sample application for interacting with the DataRobot REST API (V2).
// This is an example of a C# application that uploads a CSV dataset to DataRobot,
// runs a classification project in autopilot mode and prints the leaderboard
// using the V2 REST API. Here you can also see an example of interacting with the
// asynchronous API routes (upload project, set target).
// Since the WebClient class has limited HTTP functionality, we use the newer
// Microsoft.Net.Http.HttpClient class. Its methods are async; as a result,
// the C# code uses asynchronous operations too.
// You may need to install the following packages for this code to work:
@YuriyGuts
YuriyGuts / convert-subtitles.py
Created January 1, 2020 16:48
Converts subtitles in a video from any format to plain text using ffmpeg
"""
Converts subtitles in a video from any format to plain text using ffmpeg.
Reads all files that match a glob pattern.
Writes output to current directory unless specified otherwise.
Usage: convert-subtitles.py <input_pattern> [output_folder]
Example: convert-subtitles.py ~/Videos/*.mkv
"""
import glob
@YuriyGuts
YuriyGuts / linux-install-jetbrains-product.sh
Last active December 1, 2018 13:57
Download and install any JetBrains product (IntelliJ IDEA, PyCharm, CLion etc.) on Linux.
#!/usr/bin/env bash
# Install or upgrade any JetBrains product on Linux, assuming it is distributed as a tarball
# and has the entry point at $INSTALL_DIR/bin/$PRODUCT.sh
# Tested on IDEA, PyCharm, CLion, DataGrip 2016-2018.*
# Usage:
# install-jetbrains-product.sh [ProductName] [DownloadURL]
#
# Example:
@YuriyGuts
YuriyGuts / .centos-install-everything.sh
Last active August 31, 2018 18:18
A set of scripts to install most of the necessary software on a fresh CentOS 7 installation. Uses Dropbox to import settings.
#!/usr/bin/bash
# ----------------------
# 00-common-vars.sh
# ----------------------
# =========== CONFIG =============
# Assuming we'll set the Dropbox folder to ~/Dropbox
DROPBOX_FOLDER=$HOME/Dropbox
# ================================
@YuriyGuts
YuriyGuts / dou_salaries_translate_eng.py
Created August 19, 2018 18:43
Translate the DOU salary survey dataset (https://github.com/devua/csv/tree/master/salaries) into English
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pandas as pd
input_filename = 'https://raw.githubusercontent.com/devua/csv/master/salaries/2018_june_final.csv'
output_filename = '2018_june_final_eng.csv'
df = pd.read_csv(input_filename)
@YuriyGuts
YuriyGuts / git-update-all.py
Last active June 12, 2018 13:25
Update all Git repositories in the current folder
#!/usr/bin/env python
"""
Update all Git repos in the current directory. Fast-forward only, no merge commits.
Copyright (c) 2018 Yuriy Guts
usage: git-update-all.py
"""
from __future__ import division, print_function
@YuriyGuts
YuriyGuts / cartpole-qlearning.md
Last active October 15, 2016 23:42
An implementation of a cart pole balancing agent using Q-Learning (https://gym.openai.com/evaluations/eval_K41KvF0Re6BJW593cq2Tg).

CartPole Q-Learning Agent

Solves the OpenAI CartPole-v0 environment using a tabular version of Q-Learning with discretized feature space and epsilon-decreasing exploration.

View Repository

@YuriyGuts
YuriyGuts / cask-upgrade.sh
Last active June 13, 2016 23:41
Check for updates to all Homebrew Cask applications and upgrade them (workaround until cask gets a built-in mechanism for this)
#!/usr/bin/env bash
fetch() {
echo "Removing brew cache"
local cache=$(brew --cache)
rm -rf "$(brew --cache)"
mkdir "$cache"
mkdir "$cache/Casks"
echo "Running brew update"
brew update
@YuriyGuts
YuriyGuts / titanic-survival-lr.r
Created February 3, 2016 13:11
Predict the survival of RMS Titanic passengers using logistic regression.
# Predict the survival of RMS Titanic passengers using logistic regression.
# Based on Kaggle Titanic dataset: https://www.kaggle.com/c/titanic/data
#
# You might need to install Amelia and ROCR packages.
cleanData <- function(rawData) {
# Uncomment these two lines to visualize the missing data.
# library(Amelia)
# missmap(trainingData, main="Missing vs. observed values")
@YuriyGuts
YuriyGuts / Dump-FileTree.ps1
Created November 3, 2013 19:52
A PowerShell script that dumps the entire file tree of the specified folder(s) and saves the results to a ZIP archive.
<#
.SYNOPSIS
Dumps the entire file tree of the specified folder(s) and saves the results to a ZIP archive.
.PARAMETER SourceFolderList
Path to the folder(s) to retrieve the file tree for. Multiple folders should be separated by the pipe character ("|").
.PARAMETER BackupStorageList
Path to the folder(s) where the ZIP file will be stored. Multiple folders should be separated by the pipe character ("|").