Skip to content

Instantly share code, notes, and snippets.

View gregsonar's full-sized avatar
🐍
trying hard to do things

Gregory Dudnikof gregsonar

🐍
trying hard to do things
View GitHub Profile
@gregsonar
gregsonar / download_zeal_user_docsets.py
Last active July 14, 2020 08:03 — forked from P1xt/download_zeal_user_docsets.py
A solution to the lack of UI for Dash's user docsets in Zeal. Uses Python 3 and easygui (pip3 install easygui)
import os
import json
import tarfile
import urllib.request
import easygui
import configparser
user_docsets_url = 'https://dashes-to-dashes.herokuapp.com/docsets/contrib'
app_title = 'Download Zeal user docsets'
@gregsonar
gregsonar / userscript_reloader.js
Created March 3, 2018 13:09
Page refreshing userscript for Greasemonkey
// ==UserScript==
// @name Reload on error message
// @namespace http://userscripts.org/users/23652
// @description Reload the page on an error message you set yourself
// @version 0.5
// @author JoeSimmons, Nickel
// @grant none
// @include *
// ==/UserScript==
@gregsonar
gregsonar / image_protector.js
Last active December 1, 2017 13:07
I perfectly know that the best way to protect image download is not putting it on internet in the first place. But sometimes there are bad days...
//Development version:
function prtctImg() {
var protected_images = document.getElementsByTagName("img");
for (index = 0; index < protected_images.length; ++index) {
protected_images[index].oncopy = function() {return false;};
protected_images[index].oncut = function() {return false;};
protected_images[index].onpaste = function() {return false;};
protected_images[index].ondrag = function() {return false;};
protected_images[index].ondragstart = function() {return false;};
protected_images[index].oncontextmenu = function() {return false;};
@gregsonar
gregsonar / days.py
Last active December 27, 2016 12:13
Скрипт для правильной подстановки слова после числа (1 день, 3 дня, 12 дней и т.д.)
def plurals(n):
n = abs(n)
n %= 100
n1 = n % 10
if 20 < n > 10:
form = 'баллов'
elif 5 > n1 > 1:
form = 'балла'
elif n1 == 1:
form = 'балл'

Keybase proof

I hereby claim:

  • I am gregsonar on github.
  • I am dudnikof (https://keybase.io/dudnikof) on keybase.
  • I have a public key whose fingerprint is 5305 4250 D715 3BB0 EB8E EF9C EC70 3F6C BD01 89CB

To claim this, I am signing this object: