Skip to content

Instantly share code, notes, and snippets.

View danilvalov's full-sized avatar

Danil Valov danilvalov

  • Handsome
  • Russia, Omsk
View GitHub Profile
@danilvalov
danilvalov / rclonedeobscure.ts
Created February 22, 2024 19:59
Rclone Deobscure function (Typescript/Javascript)
/*
This is a function to decrypt (deobscure) rclone passwords
Author: Danil Valov
Original code: https://github.com/maaaaz/rclonedeobscure (Thomas D.)
*/
import crypto from 'crypto';
// AES-256-CBC always has a block size of 16 bytes
const AESBlockSize = 16;
@danilvalov
danilvalov / sass-asset-functions.js
Created February 10, 2018 18:11
[SASS/SCSS] `image-width` and `image-height` asset functions (mixins)
const path = require('path');
const sass = require('node-sass');
const imageSizeOf = require('image-size');
module.exports = {
'image-width($imageUrl)': function (imageUrl) {
const absoluteImagePath = this.options.includePaths.split(':').pop();
const absoluteImageUrl = path.resolve(absoluteImagePath, imageUrl.getValue());
const dimensions = imageSizeOf(absoluteImageUrl);
@danilvalov
danilvalov / instagram-parser-by-tag.js
Created December 14, 2017 13:04
Get instagram media array by tag
const request = require('async-request');
module.exports = async (tag) => {
try {
const response = await request(`https://www.instagram.com/explore/tags/${encodeURIComponent(tag)}/?__a=1`);
if (response.statusCode != 200) {
return throw response.statusCode;
}
@danilvalov
danilvalov / ass2srt.sh
Last active October 28, 2019 05:44
Cyrillic subtitles: .ass to .srt converter (linux, mac os x)
#!/bin/sh
IFS=$'\n'; set -f
for file in $(find ./ -name '*.ass');
do
filename=${file%.ass};
dir=$(dirname "${file}")
if [ -f "$filename".ass ] && [ ! -f "$filename".srt ];
@danilvalov
danilvalov / config.yml
Last active March 23, 2024 19:47
FlexGet: Автоматическая RSS-скачка сериалов Lostfilm.tv для новой версии сайта
templates:
global:
transmission:
host: xxxxxxxxxxxx
port: xxxx
username: xxxxxxx
password: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
tvshows:
set:
@echo off
set runtext=Запустили
tasklist|find /I "qbinder.exe">nul && ((taskkill /im "qbinder.exe">nul) && (taskkill /f /im "qbinder.exe">nul) && (set runtext=Перезапустили))
set profile=%~1
set settingsfile=C:\Progra~2\QuickBinder\settings.ini
set tmpfile=C:\Progra~2\QuickBinder\settings_tmp.ini
if exist %tmpfile% del /q %tmpfile%
@danilvalov
danilvalov / config.yml
Last active February 18, 2021 18:36
FlexGet Kinopoisk plugin
templates:
movies:
set:
path: /tmp/mnt/94E8B2B1E8B290CA/Torrents/download/DLNA/Movies
transmission:
host: ************
port: ****
username: *************
password: *************
email:
@danilvalov
danilvalov / .csscomb.json
Last active August 29, 2015 14:18
[Handsome] CSSComb Config
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
@danilvalov
danilvalov / [Handsome] Guidelines for Frontend-development.md
Last active August 29, 2015 14:18
[Handsome] Guidelines for Frontend-development
  • global structure for CSS-naming is: .block__element-subelement-subsubelement--modificator;
  • .block in CSS is page or global block of site (.header, .footer, .sidebar and others);
  • don't use tags and id's in CSS (only classes);
  • use for modification CSS-modificators only (.block__element--modificator) or pseudo-classes (:hover, :active and others);
  • use id's (<div id="idName">) and data-binds (<a data-bind="bindName">) for JavaScript only;
  • don't use classes and tags in JavaScript for binds (use id's and data-binds only);
  • use camelCase-style in JavaScript (for variable's and function's naming).