Skip to content

Instantly share code, notes, and snippets.

View lysenkooo's full-sized avatar
🏠
Remote

Denis Lysenko lysenkooo

🏠
Remote
View GitHub Profile
# Makes git push and creates Merge Request at the same time
# If you follow branch naming convention like "ucp-123/new-authorization", MR title will be "UCP-123 New authorization", which will be cross-linked to Jira
# Make sure to replace "ucp" with your shortcut.
# IMPORTANT PREREQUISITE: to run `git config committer.name <your_gitlab_username>` once, so that it gets used for `make publish!` to assign MR to you
USERNAME := $(shell git config committer.name)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ticket_pattern := ucp-[0-9][0-9][0-9]
TICKET := $(shell git rev-parse --abbrev-ref HEAD | grep -o '$(ticket_pattern)' | tr [:lower:] [:upper:])
@mutantcornholio
mutantcornholio / btt_mute.scpt
Created May 14, 2020 11:47
BetterTouchTool mute toggle
tell application "BetterTouchTool"
if input volume of (get volume settings) = 0 then
update_trigger "E932FDB1-172A-4D4A-A710-5494CC41AB3D" json "{
\"BTTIconData\": \"TU0AKgAAQAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@borischerkasky
borischerkasky / full_script.rb
Created August 11, 2019 19:18
full Github PR statistics script
class TeamPrStatistics
attr_accessor :team, :stats
class Stat
attr_accessor :titles
attr_reader :name
def initialize(name)
@name = name
@titles = []
end
@comm1x
comm1x / jira-copy-task.js
Created January 14, 2019 15:31
Add button "Copy task name" to JIRA
// ==UserScript==
// @name Copy jira task name
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://kafoodle.atlassian.net/browse/*
// @grant none
// ==/UserScript==
@jonasraoni
jonasraoni / Flattener.cs
Created July 14, 2018 14:46
Flatten Array in C#
using System;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Extends the Array with the Flatten method
/// </summary>
public static class Flattener {
/// <summary>
/// Given a N-dimensional array, flattens it into a new one-dimensional array without modifying the elements' order
@Chocksy
Chocksy / kill_sidekiq_job.rb
Last active June 20, 2024 22:55
Kill sidekiq jobs by process id for busy jobs and by jid for other sets.
# FOR BUSY JOBS
# take the process_id from the /busy page in sidekiq and kill the longest running one.
workers = Sidekiq::Workers.new
long_process_id = 'integration.3:4:71111aaa111' # Eg: 'integration.3:4:71d1d7f4ef5a'
workers.each do |process_id, thread_id, work|
process = Sidekiq::Process.new('identity' => process_id)
process.stop! if process_id == long_process_id
end
# FOR SCHEDULED JOBS
@abler98
abler98 / vk-audio-downloader.js
Last active June 24, 2024 21:55
Скрипт для скачивания музыки VK
/*
Инструкция по использованию:
- заходим в раздел с аудиозаписями
- листаем в самый низ (чтобы прогрузились все аудиозаписи)
- открываем консоль браузера (F12 -> Консоль)
- вставляем код и нажимаем ENTER
- скачивание началось...
- браузер может потребовать разрешение на сохранение файлов, необходимо подтвердить действие
@ebidel
ebidel / object-observe-proxy-polyfill.js
Last active July 29, 2021 04:08
Object.observe() polyfill using ES6 Proxies (POC)
// An `Object.observe()` "polyfill" using ES6 Proxies.
//
// Current `Object.observe()` polyfills [1] rely on polling
// to watch for property changes. Proxies can do one better by
// observing property changes to an object without the need for
// polling.
//
// Known limitations of this technique:
// 1. the call signature of `Object.observe()` will return the proxy
// object. The original object needs to be overwritten with this return value.
@blelump
blelump / aws_signed_request_v4.rb
Last active December 8, 2022 15:51
Sample Ruby code to create AWS signed request version 4 (with request headers)
#Signing AWS Requests By Using Signature Version 4
#http://docs.aws.amazon.com/general/latest/gr/sigv4_signing.html
require 'uri'
require 'openssl'
require 'net/http'
require 'cgi'
method = 'GET'
service = 'iam'
@skanev
skanev / rubocop.rb
Last active March 13, 2024 08:24
A Rubocop wrapper that checks only added/modified code
#!/usr/bin/env ruby
# A sneaky wrapper around Rubocop that allows you to run it only against
# the recent changes, as opposed to the whole project. It lets you
# enforce the style guide for new/modified code only, as opposed to
# having to restyle everything or adding cops incrementally. It relies
# on git to figure out which files to check.
#
# Here are some options you can pass in addition to the ones in rubocop:
#