Skip to content

Instantly share code, notes, and snippets.

View Bamieh's full-sized avatar

Ahmad Bamieh Bamieh

View GitHub Profile
@Bamieh
Bamieh / Instructions.md
Created September 28, 2017 17:34 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@Bamieh
Bamieh / mapOn.js
Last active October 27, 2017 15:04
Map over items that meet a certain condition, otherwise just pass the item as is.
/*
Description:
Map over an array of items:
- If the item meets the condition, apply the callback
- If the item does not meet the condition return the item without any transformation.
Example:
```
const exampleArray = [1, 2, 9, "C", "B", "C"];
import qualified Data.ByteString.Lazy as L
import Data.Word (Word8)
data Stats = Stats
{ total :: Int
, count :: Int
}
initStats :: Stats
initStats = Stats 0 0