Skip to content

Instantly share code, notes, and snippets.

View nonplus's full-sized avatar

Stepan Riha nonplus

View GitHub Profile
@nonplus
nonplus / quickpass_keynav.js
Last active August 21, 2022 03:09
QuickPass Keyboard Navigation
// ==UserScript==
// @name QuickPass Keyboard Navigation
// @namespace https://gist.github.com/nonplus
// @downloadURL https://gist.githubusercontent.com/nonplus/69f4bb7953243803ffa0e008869dba36/raw
// @updateURL https://gist.githubusercontent.com/nonplus/69f4bb7953243803ffa0e008869dba36/raw
// @version 0.1
// @description Support keyboard input (y,n,s,p,c) when filling out a QuickPass survey
// @author Stepan Riha
// @match https://*.aboquickpass.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// ==UserScript==
// @name YouTrack - PR Tile
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Based on current YouTrack Ticket, copy PR title to the clipboard
// @author Stepan Riha
// @include https://spanning.myjetbrains.com/youtrack/issue/*
// @run-at context-menu
// @grant GM_setClipboard
// ==/UserScript==
// ==UserScript==
// @name YouTrack - Git Branch
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Based on current YouTrack Ticket and logged in user, copy git branch command to the clipboard
// @author Stepan Riha
// @match https://*.myjetbrains.com/youtrack/issue/*
// @run-at context-menu
// @grant GM_setClipboard
// ==/UserScript==
@nonplus
nonplus / pg_partman 3.1.1 for RDS.sql
Created January 13, 2018 19:34
Patched version of pg_partman 3.1.1 to use in RDS
-- Patched version of pg_partman 3.1.1 to use in RDS
-- https://github.com/keithf4/pg_partman
--SR: ADDED Create and use partman schema
CREATE SCHEMA partman;
SET search_path TO partman;
CREATE TYPE check_parent_table AS (parent_table text, count bigint);
CREATE TABLE part_config (
parent_table text NOT NULL
, control text NOT NULL
@nonplus
nonplus / bookmarklet.md
Last active October 19, 2018 15:46
Puts a "git branch -b branch-name" on the clipboard where branch-name is based on your initials and issue id

Usage

  • Add the compiled bookmarklet to your browser's bookmarks
  • Go to a YouTrack issue page
  • Click on the bookmarklet
  • An alert shows the git branch command that has been copied to the clipboard

Compiled bookmarklet:

`javascript:(function()%7B%24name%20%3D%20document.querySelectorAll('%5Bdata-test%3D%22ring-dropdown%20ring-profile%22%5D')%5B0%5D%3Bissueid%20%3D%20location.pathname.split(%22%2F%22).pop()%20%7C%7C%20%22%22%3Bbranch%20%3D%20%22%22%3Bif%20(%24name%20%26%26%20issueid.match(%2F-%5Cd%2B%24%2F))%20%7Binls%20%3D%20(%24name.title%20%7C%7C%20%22%22).split(%2F%5Cs%2B%2F).map(s%20%3D%3E%20s%5B0%5D%20%7C%7C%20%22%22).join(%22%22).toLowerCase()%3Bbranch%20%3D%20inls%20%2B%20%22%2F%22%20%2B%20issueid%3Bconsole.log(%22branch%3A%20%22%20%2B%20branch)%7D%20else%20%7Bconsole.log(%22could%20not%20create%20branch%20name%22)%7Dif%20(branch)%20%7Bvar%20cb%20%3D%20document.createElement('TEXTAREA')%3Bvar%20cmd%20%3D%20%22git%20checkout%20-b%20%22%20%2B%20branch%3Bcb.value%20%3D%20cmd%3Bdocument.body.app

@nonplus
nonplus / ec2-login-bookmarklet
Last active February 10, 2017 15:16
Scrapes an AWS EC2 instance page and copies the ssh login command to the clipboard
// Configure the pemDir value (or make empty for current directory) and generate a bookmarklet (http://bookmarklets.org/maker/)
// Use the bookmarklet in the AWS dashboard on an EC2 instance page
// Paste into terminal shell
// Voila!
var pemDir = '/path/to/directory/with/pem/files/';
var elts = document.getElementsByTagName("DIV");
var dns = valueOf('Public DNS (IPv4)');
if (!dns) { return; }
@nonplus
nonplus / README.md
Last active November 4, 2016 14:06 — forked from nch3v/README.md
Typescript mixins
@nonplus
nonplus / jade-to-pug.sh
Created October 14, 2016 20:24
Rename *.jade to *.pug in git
for file in $(git ls-files *.jade); do git mv $file $(echo $file | sed -e 's/\([^/]*\).jade/\1.pug/'); done