Skip to content

Instantly share code, notes, and snippets.

Avatar

Sidu Ponnappa kaiwren

View GitHub Profile
@kaiwren
kaiwren / jira_csv_report.rb
Created Sep 6, 2022
Generate a simple summary from a Jira full excel CSV export
View jira_csv_report.rb
require 'csv'
csv_file = ARGV[0]
def section_heading(title)
"\n#{'-' * 10} #{title} #{'-' * 10}\n\n"
end
rows = CSV.read(csv_file)[1..-1].map do |r|
created_at = DateTime.parse(r[21])
View hiring-segments.md
Can Code Can't Code
Loves Coding Yes N/A
Hates Coding Maybe No
View operation_before.go
type Operation struct {
timeValue time.Time
s2IDLevel int64
s2ID int64
// ...
// ...
}
func (op operation) Perform() error {
surgeRepository := repository.NewSurgeRepository()
View operation_after.go
type Operation struct {
timeValue time.Time
s2IDLevel int64
s2ID int64
// ...
// ...
}
func (op operation) Perform(surgeRepository repository.SurgeRepository) error {
// ...
View operation_after.go
type Operation struct {
timeValue time.Time
s2IDLevel int64
s2ID int64
// ...
// ...
}
func (op operation) Perform(surgeRepository repository.SurgeRepository) error {
// ...
View array_clone_spec.rb
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
require File.expand_path('../shared/clone', __FILE__)
describe "Array#clone" do
it_behaves_like :array_clone, :clone
it "copies frozen status from the original" do
a = [1, 2, 3, 4]
b = [1, 2, 3, 4]
View object_clone_spec.rb
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../shared/dup_clone', __FILE__)
describe "Object#clone" do
it_behaves_like :object_dup_clone, :clone
it "preserves frozen state from the original" do
o = ObjectSpecDupInitCopy.new
o2 = o.clone
o.freeze
@kaiwren
kaiwren / gameoflife.js
Created Mar 13, 2015
Compiled GoL via Opal
View gameoflife.js
(function(undefined) {
if (typeof(this.Opal) !== 'undefined') {
console.warn('Opal already loaded. Loading twice can cause troubles, please fix your setup.');
return this.Opal;
}
// The Opal object that is exposed globally
var Opal = this.Opal = {};
// All bridged classes - keep track to donate methods from Object
@kaiwren
kaiwren / bm_factorial_inline_js.rb
Created Mar 9, 2015
Opal Microbenchmarks with inline js from github.com/kaiwren/redson
View bm_factorial_inline_js.rb
module Benchmarks
def self.fact_inline_js(n)
%x{
if(n > 1) {
return n * this.$fact_inline_js(n-1);
}
else {
return 1;
}
}
@kaiwren
kaiwren / bm_factorial.js
Last active Aug 29, 2015
Opal Microbenchmarks from github.com/kaiwren/redson
View bm_factorial.js
JS.Benchmarks.fact = function(n){
if(n > 1) {
return n * this.fact(n-1);
}
else {
return 1;
}
}