This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"time" | |
) | |
func main() { | |
startTime := time.Now() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/pkg/errors" | |
) | |
var ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"sync" | |
"time" | |
"github.com/pkg/errors" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p1_name = gets.to_s.chomp | |
p2_name = gets.to_s.chomp | |
p1 = Player.new(p1_name) | |
p2 = Player.new(p2_name) | |
puts Game.new(p1, p2).start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
exec ruby -S -x $0 "$@" | |
#! ruby | |
class PreCommitExecutor | |
COMMANDS = ['bundle exec rspec', 'bundle exec rubocop'] | |
def run | |
status = COMMANDS.map {|cmd| system(cmd) }.all? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_tournament(players) | |
seeds = (2 ** Math.log2(players.size).ceil) - players.size | |
players.map.with_index {|player, i| i < seeds ? [player, player] : player }.flatten | |
end | |
def janken(player1, player2) | |
p1 = player1; p2 = player2 | |
p1 = player1 * 10 | |
p2 = player2 * 10 | |
min = [p1.size, p2.size].min |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pry' | |
class Tournament | |
def initialize(data) | |
@members = data[1..-2].split(")(") | |
end | |
def get_enemy(members, player_num) | |
if members % 2 == 1 | |
return if player_num == members - 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/google/go-github/github" | |
"github.com/skratchdot/open-golang/open" | |
"log" | |
"os" | |
"regexp" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LunchMember | |
def initialize(data) | |
@data = data | |
end | |
def show_combination | |
members = @data.flatten.uniq | |
lunch_patterns = members.combination(3).to_a | |
result = [] |
NewerOlder