Skip to content

Instantly share code, notes, and snippets.

View vlakam's full-sized avatar
🎯
Focusing

Vladislav K. vlakam

🎯
Focusing
View GitHub Profile
const { utimesSync } = require('fs');
const { Airgram, Auth, isError, prompt, toObject, Message } = require('airgram');
const probe = require('node-ffprobe');
const tdLibFile = process.platform === 'win32' ? 'tdjson.dll' : 'libtdjson.so'
const { API_ID, API_HASH, CHAT_ID } = process.env;
const airgram = new Airgram({
apiId: API_ID,
apiHash: API_HASH,
@vlakam
vlakam / gsecount.R
Last active July 5, 2019 08:01
Count GSE which are good
library(httr)
library(GEOmetadb)
library(rhdf5)
library(tidyr)
isGPLAnnotGood <- function (gpl) {
stub = gsub('\\d{1,3}$','nnn',gpl,perl=TRUE)
gplurl <- 'https://ftp.ncbi.nlm.nih.gov/geo/platforms/%s/%s/annot/%s'
myurl <- sprintf(gplurl,stub,gpl,paste0(gpl,'.annot.gz'))
FROM arm64v8/ubuntu
RUN apt-get update
ARG LUA_VERSION=5.1
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install libreadline-dev libssl-dev lua5.1 liblua5.1-dev git make unzip redis-server curl libcurl4-gnutls-dev wget && \
wget http://luarocks.org/releases/luarocks-2.2.2.tar.gz && \
tar zxpf luarocks-2.2.2.tar.gz && \
cd luarocks-2.2.2 && \
sh ./configure --lua-version=${LUA_VERSION} && \
@vlakam
vlakam / m3u.js
Last active September 25, 2018 16:21
m3u downloader and id3tag fixer
const m3u = require('m3ujs');
const {promisify} = require('util');
const sanitize = require("sanitize-filename");
const fetch = require('node-fetch');
const ID3Writer = require('browser-id3-writer');
const fs = require('fs');
const path = require("path");
const readFileAsync = promisify(fs.readFile);
const writeFileAsync = promisify(fs.writeFile);
const jsmediatags = require("jsmediatags");
#TabsToolbar {
visibility: collapse;
}
#titlebar {
display: none;
}
#nav-bar {
margin-top: 10px;
backend = "glx";
paint-on-overlay = true;
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
vsync = "opengl-swc";
# These are important. The first one enables the opengl backend. The last one is the vsync method. Depending on the driver you might need to use a different method.
# The other options are smaller performance tweaks that work well in most cases.
# You can find the rest of the options here: https://github.com/chjj/compton/wiki/perf-guide, and here: https://github.com/chjj/compton/wiki/vsync-guide
Section "ServerLayout"
Identifier "layout"
Screen 0 "intel"
Screen 1 "radeon" LeftOf "intel"
EndSection
Section "Device"
Identifier "radeon"
Driver "radeon"
BusID "PCI:1:0:0"
@vlakam
vlakam / search3.cpp
Created March 10, 2016 21:58
Substring with 1 or 0 mistmatch
//
// Created by kamenev on 09.03.16.
//
#include <fstream>
#include <vector>
#include <iterator>
#include <algorithm>
#define IN "search3"
@vlakam
vlakam / ifmo8.cpp
Created January 16, 2014 20:14
Задача ИТМО. Второй отборочный тур.
#include <iostream>
#include <ostream>
#include <fstream>
#include <cmath>
#include <ctime>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
using namespace std;
@vlakam
vlakam / 802.cpp
Last active December 31, 2015 17:19
Даны k предметов с массами m1, m2,...mk. Выделите все группы предметов, у которых сумма масс равна S. http://breedpmnr.ru/i/6aea94f653115c4e53bbfc4d8e2d.jpg
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
stack<int> m;
vector<pair<bool,int>> items;
int ss=0;
inline int summ(std::stack<int> in)
{
int s=0;