Skip to content

Instantly share code, notes, and snippets.

Ivan Doroshenko ploddi

Block or report user

Report or block ploddi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View auto-prepend-jira-id-to-git-commit-msg.md

Automatically Prepend a Jira Issue ID to Git Commit Messages

Use a git hook to match a Jira issue ID from the current branch, and prepend it to every commit message

Assuming the current branch contains a Jira issue ID, you can use a git hook script to prepend it to every commit message.

  1. Create an empty commit-msg git hook file, and make it executable. From your project's root directory:

     install -b -m 755 /dev/null .git/hooks/commit-msg
    
  2. Save the following script to the newly-created .git/hooks/commit-msg file:

View gist:b3bc2e2f8694afa26a04213b7ff5294c

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

View CoreDisplay.tbd
--- !tapi-tbd-v2
archs: [ i386, x86_64 ]
uuids: [ 'i386: 0317C0DA-680A-394F-AAD2-45D4CEB2CF9F', 'x86_64: E52EFE94-982C-3DCE-A032-0E275E67B77B' ]
platform: macosx
install-name: /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay
objc-constraint: none
exports:
- archs: [ x86_64 ]
symbols: [ _CDWSNotifyProc, _CGXAcceleratorForDisplayDevice, _CGXAccessCaptureSurfaceForDisplayDevice,
_CGXAccessDisplayDeviceSurface, _CGXAccessIOSurfaceForDisplayDevice,
View keybase.md

Keybase proof

I hereby claim:

  • I am ploddi on github.
  • I am ploddi (https://keybase.io/ploddi) on keybase.
  • I have a public key ASCVobyZbADat62KE2vJaq_caybeXuvB2hzKlyaUejaCMAo

To claim this, I am signing this object:

View tfi.md

Revisiting Tagless Final Interpreters with Dotty

Tageless Final interpreters are an alternative to the traditional Algebraic Data Type (and generalized ADT) based implementation of the interpreter pattern. This document presents the Tageless Final approach with Scala, and shows how Dotty with it's recently added implicits functions makes the approach even more appealing. All examples are direct translations of their Haskell version presented in the Typed Tagless Final Interpreters: Lecture Notes (section 2).

The interpreter pattern has recently received a lot of attention in the Scala community. A lot of efforts have been invested in trying to address the biggest shortcomings of ADT/GADT based solutions: extensibility. One can first look at cats' Inject typeclass for a naive implementation of [Data Type à la Carte](http://www.cs.ru.nl/~W.Swierstra/Publica

@ploddi
ploddi / README.md
Created Sep 9, 2016 — forked from pathikrit/README.md
My highly opinionated list of things needed to build an app in Scala
View README.md
View gist:8ef2b906286117af4971
/**
* Based on
* https://github.com/mandubian/shapelaysson/blob/master/src/main/scala/shapelaysson.scala
*/
package object test {
import shapeless._
import shapeless.HList._
import play.api.libs.json._
import play.api.libs.functional.Functor
import play.api.libs.functional.syntax._
@ploddi
ploddi / gist:8952796
Last active Oct 23, 2019
AFHTTPSessionManager+ReactiveCocoa
View gist:8952796
@implementation AFHTTPSessionManager (ReactiveCocoa)
- (RACSignal *)rac_signalForHTTPMethod:(NSString *)method
path:(NSString *)path
parameters:(NSDictionary *)parameters {
return [RACSignal create:^(id<RACSubscriber> subscriber) {
NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:path relativeToURL:self.baseURL] absoluteString] parameters:parameters error:nil];
__block NSURLSessionDataTask *task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse * __unused response, id responseObject, NSError *error) {
View SprayBsonSupport.scala
import spray.json._
import reactivemongo.bson._
import scala.language.implicitConversions
trait BSONDocumentFormat[T] extends BSONDocumentReader[T] with BSONDocumentWriter[T]
object SprayBson {
implicit object BSONObjectIDJsonFormat extends JsonFormat[BSONObjectID] {
def write(id: BSONObjectID) = JsString(id.toString)
You can’t perform that action at this time.