Skip to content

Instantly share code, notes, and snippets.

View mgrebenets's full-sized avatar
🐢

Maksym Grebenets mgrebenets

🐢
View GitHub Profile
@mgrebenets
mgrebenets / git-hooks.md
Last active August 29, 2015 14:22
Git Hooks

Git Hooks

Use git hooks to automatically add JIRA ID at the start of each commit message.

Main Project Repo

Navigate to the root of the main project repository.

Create a copy of .git/hooks/commit-msg.sample and name it commit-msg.

@mgrebenets
mgrebenets / bitbucket-branches-job-dsl.groovy
Created June 8, 2015 01:02
Jenkins Job DSL Example - Bitbucket Branches
//
// Jenkins Job DSL example to create build projects for Bitbucket branches
//
// Imports
import java.text.DateFormat
import java.text.SimpleDateFormat
import groovy.time.TimeCategory
// URL components
#!/bin/bash
# Fix source file header by removing current header and inserting standard copyright notice
# Works for all C-based files, uses // comment style, current year and specified company name
# Doesn't work for empty files
# Temp directory
TMP_DIR=$(mktemp -dt "XXXXXXXX")
# Log
@mgrebenets
mgrebenets / fix-objc-imports.sh
Last active January 2, 2020 17:48
Fix Objective-C Imports
#!/bin/bash
# Fix Objective-C import statements
# Replace all system framework imports of #import <Path/Path.h> type with @import Path;
# Temp directory
TMP_DIR=$(mktemp -dt "XXXXXXXX")
# Log
log () {
@mgrebenets
mgrebenets / i4napps-atlassian-cli.rb
Created June 8, 2015 11:57
Atlassian CLI Homebrew Formula
require 'formula'
# Homebrew formula to install atlassian CLI tools
class I4nAppsAtlassianCli < Formula
version "3.9.0"
def release() "1" end # custom release field
def java_version() ENV["JAVA_VERSION"] || "1.6" end # java version to set JAVA_HOME
homepage 'https://marketplace.atlassian.com/plugins/org.swift.atlassian.cli'
url "https://marketplace.atlassian.com/download/plugins/org.swift.atlassian.cli/version/#{version.to_s.delete('.')}"
@mgrebenets
mgrebenets / nsbogan-atlassian-cli-rpm.spec
Created June 8, 2015 12:01
NSBogan Atlassian CLI RPM Spec
%define __spec_install_post %{nil}
%define __os_install_post %{nil}
%define debug_package %{nil}
Summary: nsbogan-atlassian-cli
Name: nsbogan-atlassian-cli
Version: %{version}
Release: %{release}
License: Atlassian EULA Standard License
Vendor: Bob Swift Software, LLC
Packager: Maksym Grebenets <mgrebenets@gmail.com>
@mgrebenets
mgrebenets / RPMMakefile.mak
Last active October 16, 2020 16:37
RPM Makefile
PACKAGE = nsbogan-atlassian-cli
VERSION = 3.9.0
RELEASE = 1
ARCH = noarch
NSBOGAN_USERNAME = automation
NSBOGAN_PASSWORD = automation
JAVA_VERSION = 1.6
PACKAGE_URL = https://marketplace.atlassian.com/download/plugins/org.swift.atlassian.cli/version/$(subst .,,${VERSION})
# Source directory
@mgrebenets
mgrebenets / share-schemes.rb
Created June 8, 2015 12:04
Share Xcode Schemes
#!/usr/bin/env ruby
# share_schemes.rb
require 'optparse'
require 'ostruct'
require 'rubygems'
require 'xcodeproj'
require 'colorize'
require 'fileutils'
@mgrebenets
mgrebenets / dictionary-literal-convertible.swift
Created June 8, 2015 12:05
Swift Dictionary Literal Convertible
import Foundation
/// Timeout Options
struct Options {
let timeout: Double = 1 // timeout in seconds
let message = "Timeout failed." // message to display on timeout
}
/// Wait for something with timeout options
func wait(options: Options) {
@mgrebenets
mgrebenets / objc-interop.swift
Created June 8, 2015 12:06
Swift Objective-C Interoperability
import AppKit
typealias BaseObjCClass = NSObject
enum PureSwiftEnum {
case Value, AnotherValue
}
protocol PureSwiftProtocol {
var value: PureSwiftEnum { get }
var size: CGSize { get }