Skip to content

Instantly share code, notes, and snippets.

@naush
naush / rcv.rb
Created May 11, 2020 10:38
Ranked Choice Kata – First Test
# frozen_string_literal: true
class RCV
def count(votes:, candidates:); end
end
.g {
width: 1px;
height: 1px;
background:
linear-gradient(rgba(178, 86, 86, 1), rgba(178, 86, 86, 1)) 0px 0px /
1px 1px;
background-repeat: no-repeat;
}

Agenda

  • Presenter go over kata step by step – 15 minutes
  • First round of pairing – 20 minutes
  • Retrospective – 10 minutes
  • Break – 10 minutes
  • Second round of pairing – 20 minutes
  • Retrospective – 10 minutes
  • Break – 10 minutes
  • Mob programming – 30 minutes
@naush
naush / example_story.md
Last active July 1, 2019 21:51
PTO Calculator Capstone Project

Example Story

As a Crafter, I want to know how many PTO days I have left this year so that I can plan for my upcoming vacation.

Acceptance Criteria

Given that I am a first year Crafter
And I started on January 1st, 2019
And I have not taken any holiday
And today is July 1st, 2019

Housekeeping

We will be paying an additional $60 per week to PencilWorks to assist us with deep office cleaning. Please keep in mind that one session should not be over 1.5 to 2 hours. PencilWorks staff will be working through the tasks early in the morning.

Please review the list of tasks below.

Two Days a Week

  • Vacuum floors
  • Sweep desks & window sills
@naush
naush / generator.es6.js
Created December 27, 2015 17:30
ES6 Generator example
*range (begin, end, interval = 1) {
for (let number = begin; number <= end; number += interval) {
yield number
}
}
let hours = [...this.range(0, 360, 30)] // [0, 30, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360]
require 'octokit'
require 'csv'
client = Octokit::Client.new(access_token: 'ACCESS_TOKEN')
client.auto_paginate = true
open = client.issues('namely/issues', headers: { 'x-oauth-basic' => 'ACCESS_TOKEN' })
closed = client.issues('namely/issues', headers: { 'x-oauth-basic' => 'ACCESS_TOKEN' }, state: 'closed')
issues = open + closed
CSV.open("filename.csv", "wb") do |csv|
@naush
naush / employee.rb
Created October 15, 2014 16:16
wioletta
class Employee
attr_accessor :boss
attr_accessor :subordinates
def initialize
@subordinates = []
end
def children
[].tap do |array|
<script>
var Button = React.createClass({
propTypes: {
title: React.PropTypes.string
},
render: function() {
return React.DOM.button({}, this.props.title);
}
});
@naush
naush / peco
Last active August 29, 2015 14:03
Interactive filtering git branch
$ brew tap peco/peco
$ brew install peco
$ vim ~/.gitconfig
# add `pc = "! git checkout $(git branch | peco)"` to [alias]