Skip to content

Instantly share code, notes, and snippets.

View vyach-vasiliev's full-sized avatar

ฬะทçะรโลนร vyach-vasiliev

  • Milky Way galaxy, planet Earth
View GitHub Profile
@vyach-vasiliev
vyach-vasiliev / dabblet.css
Created April 27, 2016 13:50
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@vyach-vasiliev
vyach-vasiliev / rules_for_tagscanner.tst
Last active March 11, 2017 22:02
Rules replaces for Tagscanner
# Tagscanner text tranform script
[proc1]
name=VVRules
active=0
act1=1
act2=0
act3=0
s=3
c=4
t=--ALL
@vyach-vasiliev
vyach-vasiliev / rules_replaces_for_tagscanner.md
Last active March 12, 2017 09:38
Rules regex-replaces for TagScanner

Rules regex-replaces in TagScanner

Download .tst file with rules

Thank you for your attention! 😊

Please write to me if you encounter a problem or wish to supplement the list! 🔥

For different length dashes

[—–] -> - (simbol [minus])

@vyach-vasiliev
vyach-vasiliev / hex&rgb_converting.py
Created April 6, 2017 07:43
HEX to RGB, RGB to HEX (variations)
######## Variant 1 ########
# using struct: https://docs.python.org/2/library/struct.html
import struct
def hex2rgb(rgb):
return struct.unpack('BBB', rgb.decode('hex'))
def rgb2hex(rgb):
return struct.pack('BBB',*rgb).encode('hex')
@vyach-vasiliev
vyach-vasiliev / get_comb_expressions_for_number.py
Last active April 8, 2017 12:08
Get combinations of expressions for number N
import re, json, collections, math, itertools
def get_comb_exp_for_number_v32_clean(for_number, numbers, wo_dupl=False, more=False, debug=False):
""" v3.2 Clean version
wo_dupl - Returns right expressions without duplicates (9.*2./1.-8. = 2.*9./1.-8.)
more - Returns detailed statistics
debug - Returns right expressions and print detailed statistics
"""
@vyach-vasiliev
vyach-vasiliev / _fix_lockselection-allsites.user.js
Last active April 24, 2017 19:26
Fix lock selection text on WEB-Page / UserScript
// ==UserScript==
// @name _Fix lock selection text [allsites]
// @version 1.3
// @description fix blocking selection on all sites
// @author Vyachesl Vasiliev
// @include *
// @downloadURL https://gist.githubusercontent.com/vyach-vasiliev/8dfb5f5b3c22e1fc74da180f00685929/raw
// @updateURL https://gist.githubusercontent.com/vyach-vasiliev/8dfb5f5b3c22e1fc74da180f00685929/raw
// @copyright © MIT, 2017, Vyacheslav Vasiliev
// @grant none
@vyach-vasiliev
vyach-vasiliev / upc.py
Last active April 25, 2017 19:11
Useful pieces of code
from win32com.shell import shell, shellcon
def get_startup_directory(common):
"""
Copyright Tim Golden <winshell@timgolden.me.uk> 25th November 2003 - 2012
Licensed under the (GPL-compatible) MIT License:
http://www.opensource.org/licenses/mit-license.php
"""
return shell.SHGetFolderPath(0, (shellcon.CSIDL_STARTUP, shellcon.CSIDL_COMMON_STARTUP)[common], None, 0)
get_startup_directory(0) # 'C:\\Users\\<USERNAME>\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup'
get_startup_directory(1) # 'C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Startup'
@vyach-vasiliev
vyach-vasiliev / to_patch.py
Last active April 25, 2017 19:26
Patch script for resources.pak of Google Chrome
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os, re
from grit.format import data_pack
def to_patch(patch_rules):
""" Patch for resources.pak file into part of Chrome browser
patch_rules - Dictionary with meanings
input_file - Path to input file (creates a backup)
@vyach-vasiliev
vyach-vasiliev / storageConverter.js
Last active May 2, 2017 22:26
localStorage or sessionStorage to json, json to localStorage or sessionStorage, localStorage2json, json2localStorage, sessionStorage2json, json2sessionStorage
function storage2json(storage){
/* storage2json, v1.5, Copytight 2017, MIT License, Vyach.Vasiliev
The MIT License
Copyright (c) 2017 Vyacheslav Vasiliev (vyach.vasiliev\аt\gmail\dоt\com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@vyach-vasiliev
vyach-vasiliev / return_old_design_of_wv_spotify.md
Last active May 9, 2017 09:49
Return the old design of the web version of Spotify

Return the old design of the web version of Spotify

If you are working in an Chrome-like browser, then the extension of User-Agent Switcher (https://superuser.com/a/445873/589421) will help you.

Just add new "Custom-User Agent" and then new add the record to the "Permanent Spoof list":

User-Agent String:

Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.2970.0 Safari/537.36