Skip to content

Instantly share code, notes, and snippets.

View eprislac's full-sized avatar
🎯
Focusing

Eddie Prislac eprislac

🎯
Focusing
View GitHub Profile
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <numeric>
using namespace std;
map<string, bool, greater<string>> fbMap(int num) {
map<string, bool, greater<string>> tbl;
(defn fizzbuzziness [num]
  (def tbl {"Fizz" (mod num 3),"Buzz" (mod num 5)})
  (clojure.string/join "" (filter (comp #{0} tbl) (keys tbl))))
class Integer
  def fizzbuzziness
  { 'Fizz' => (self % 3).zero?, 'Buzz' => (self % 5).zero? }
  .select { |_key, value| value }
  .keys
  .inject('') { |prev, curr| "#{prev}#{curr}" }
  end
end
@eprislac
eprislac / array_count_equals_fish.rb
Created February 22, 2019 08:10
An example of the wrong thing to do when reopening a Ruby class
# Never do this for real.
class Array
def count
'fish'
end
end
@eprislac
eprislac / pull_request_template.md
Last active January 24, 2019 00:11
pull_request_template.md

RELATED STORY

<story_type_all_caps(BUG | FEATURE | CHORE)> - <story_title>
[#<story_number>]

DESCRIPTION

Add description here - should describe the problem

STEPS TO REPRODUCE ISSUE

@eprislac
eprislac / .gitmessage
Last active January 21, 2019 21:29
.gitmessage
# Subject (one line summary of description)
# __RELATED STORY:__
# __<BUG | FEATURE | CHORE>__ - *<Story Title>*
# \[[#<story-id>](<story-url>)\]
# __DESCRIPTION:__
# Body (What and Why)
# Elaborate on the reasons changes were made here
@eprislac
eprislac / datepicker.component.js
Last active September 20, 2017 09:11
Angular 1.5 datetimepicker component
(function() {
angular.module('DatepickerModule', [])
})();
(function() {
'use strict';
/**
* This component is my alternative to the directive wrapper approach, and makes use of
* component's onUpdate method to pass in a callback to the parent component.