Skip to content

Instantly share code, notes, and snippets.

@oeN
oeN / main.yml
Created May 5, 2020 08:13
godot - build and release on itch.io
# This is a basic workflow to help you get started with Actions
name: Build and release
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
@oeN
oeN / weighted.rb
Last active April 29, 2020 19:34
Shuffle a Weighted array in Ruby
def weighted
a = []
(1..60).each do |i|
a << { value: "HIGH_#{i}", weight: 5 }
end
(1..30).each do |i|
a << { value: "MID_#{i}", weight: 3 }
end
(1..15).each do |i|
a << { value: "LOW_#{i}", weight: 2 }

Keybase proof

I hereby claim:

  • I am oen on github.
  • I am diomedet (https://keybase.io/diomedet) on keybase.
  • I have a public key whose fingerprint is ADB1 8D55 B88E 29F0 CC05 7AD6 4711 84D3 9848 8D73

To claim this, I am signing this object:

@oeN
oeN / parser.rb
Last active August 29, 2015 14:19 — forked from nicolaracco/parser.rb
basic tokenizer and parser with an approach of Polish notation for calcs
require 'tokenizer'
class Parser
attr_reader :tokens, :prioritize
GRAMMAR = {
number: "insert_operand",
operator: "insert_operator",
open_bracket: "open_bracket",