Skip to content

Instantly share code, notes, and snippets.

@and-rom
and-rom / habrahabr.meta.js
Last active May 21, 2020 13:05
Habrahabr
// ==UserScript==
// @name Habrahabr
// @namespace https://gist.github.com/and-rom/29ac0ef2f5d0dacd79e3668206c02260
// @version 0.1.0
// @author and-rom
// @description Clear Habrahabr post page for saving as PDF in Google Chrome. When loading finished press Alt-S.
// @homepage https://gist.github.com/and-rom/29ac0ef2f5d0dacd79e3668206c02260
// @icon https://habr.com/images/favicon-16x16.png
// @icon64 https://habr.com/images/favicon-32x32.png
// @updateURL https://gist.github.com/and-rom/29ac0ef2f5d0dacd79e3668206c02260/raw/habrahabr.meta.js
// ==UserScript==
// @name JIRA
// @namespace https://gist.github.com/and-rom/31b76f77438e79ab2caeba0073220732
// @version 0.2.2
// @author and-rom
// @description Auto fill on JIRA
// @homepage https://gist.github.com/and-rom/31b76f77438e79ab2caeba0073220732
// @icon https://jira.voskhod.ru/s/ru_RUvxfa23/6346/125/_/favicon.ico
// @icon64 https://jira.voskhod.ru/s/ru_RUvxfa23/6346/125/_/favicon.ico
// @updateURL https://gist.github.com/and-rom/31b76f77438e79ab2caeba0073220732/raw/jira.meta.js
@and-rom
and-rom / youtube.meta.js
Last active May 21, 2020 13:07
Youtube Wide Screen
// ==UserScript==
// @name Youtube Wide Screen
// @namespace https://gist.github.com/and-rom/24e3a2d5d3b816dfeefa9fcbdd875e8f
// @version 0.1.1
// @author and-rom
// @description Click on Wide Screen button
// @homepage https://gist.github.com/and-rom/24e3a2d5d3b816dfeefa9fcbdd875e8f
// @icon https://www.gstatic.com/youtube/img/branding/favicon/favicon_48x48.png
// @icon64 https://www.gstatic.com/youtube/img/branding/favicon/favicon_48x48.png
// @updateURL https://gist.github.com/and-rom/24e3a2d5d3b816dfeefa9fcbdd875e8f/raw/youtube.meta.js
@and-rom
and-rom / myparcels.meta.js
Last active September 7, 2021 18:00
myparcels
// ==UserScript==
// @name myparcels
// @namespace https://gist.github.com/and-rom/7def3e0ef56c0a8222442b71022203cf
// @version 0.1.10
// @author and-rom
// @description Minor style changes. Paste date from clipboard to parcel add form by pressing Alt+Shift+V
// @homepage https://gist.github.com/and-rom/7def3e0ef56c0a8222442b71022203cf
// @icon https://myparcels.ru/favicon.png
// @icon64 https://myparcels.ru/favicon.png
// @updateURL https://gist.github.com/and-rom/7def3e0ef56c0a8222442b71022203cf/raw/myparcels.meta.js
@and-rom
and-rom / imperial_march_ardu.ino
Created December 12, 2016 10:55
Arduino code to easily play music with buzzer (The imperial March - STAR WARS)
// NB: ALL NOTES DEFINED WITH STANDARD ENGLISH NAMES, EXCEPT FROM "A"
//THAT IS CALLED WITH THE ITALIAN NAME "LA" BECAUSE A0,A1...ARE THE ANALOG PINS ON ARDUINO.
// (Ab IS CALLED Ab AND NOT LAb)
#define C0 16.35
#define Db0 17.32
#define D0 18.35
#define Eb0 19.45
#define E0 20.60
#define F0 21.83
#define Gb0 23.12
@and-rom
and-rom / noise.php
Created October 28, 2016 10:53
Creates a random image to illustrate generator of random numbers PHP.
<?php
// Creates a random image to illustrate generator of random numbers PHP.
// Requires the GD Library
header("Content-type: image/png");
function make_seed()
{
list($usec, $sec) = explode(' ', microtime());
return $sec + $usec * 1000000;
@and-rom
and-rom / swipeFunc.js
Last active August 29, 2015 14:25 — forked from localpcguy/swipeFunc.js
Simple Mobile Swipe function to get the swipe direction
var swipeFunc = {
touches : {
"touchstart": {"x":-1, "y":-1},
"touchmove" : {"x":-1, "y":-1},
"touchend" : false,
"direction" : "undetermined"
},
touchHandler: function(event) {
var touch;
if (typeof event !== 'undefined'){
@and-rom
and-rom / swipe.js
Last active August 29, 2015 14:25
Swipe function to get the swipe direction
document.addEventListener('touchstart', handleTouchStart, false);
document.addEventListener('touchmove', handleTouchMove, false);
var xDown = null;
var yDown = null;
function handleTouchStart(evt) {
xDown = evt.touches[0].clientX;
yDown = evt.touches[0].clientY;
};
@and-rom
and-rom / bookmarklets.js
Last active August 29, 2015 14:22
Collection of usefull bookmarklets
//<!-- Moscow Metro Wi-Fi redirect to previous page -->
//<DT><A HREF="javascript:
(function(){
var vars = window.location.search.substring(1).split('&');
for (var i=0;i<vars.length;i++) {
if(vars[i].split('=')[0] == 'redirect'){var result=vars[i].split('=')[1];}
}
if (typeof result != 'undefined'){window.location.href = 'http://'+result;}
})();
//">mr</A>
@and-rom
and-rom / ch.recipe
Created February 20, 2015 14:25
calibre habrahabr recipe
import sys, socket, os, urlparse, re, time, copy, urllib2, threading, traceback
from urllib import url2pathname, quote
from httplib import responses
from base64 import b64decode
from calibre import browser, relpath, unicode_path, fit_image
from calibre.constants import filesystem_encoding, iswindows
from calibre.utils.filenames import ascii_filename
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
from calibre.ebooks.chardet import xml_to_unicode