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 / 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 / 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 }
@mgrebenets
mgrebenets / Sample.m
Last active November 10, 2015 11:43
Objective-C Code Formatting Sample
//
// Copyright blah-blah
//
// ---
// Group of assignments
int x = 5;
int longVariableName = 444;
unsigned long long anotherVar = 3;
#!/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 / 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 / block-call-vs-yeild.rb
Created January 20, 2016 06:15
Use of block.call vs yield
def platform_call(platform_name, &block)
puts "SupportedPlatforms.verify!(platform_name)"
puts "self.current_platform = platform_name"
block.call
puts "self.current_platform = nil"
end
def platform_yield(platform_name, &block)
@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 / __MAGIKCRAFT__.mgrebenets.package_json.md
Created August 15, 2017 09:34
Magikcraft API: package_json files, by mgrebenets.