Skip to content

Instantly share code, notes, and snippets.

View dgamboa's full-sized avatar

Daniel Gamboa dgamboa

View GitHub Profile
@dgamboa
dgamboa / indexer-docs.md
Last active April 26, 2023 16:30
Documentation for Figment Celo & Near Indexers

Celo

Celo Indexer Endpoints:

Method Path Description Params
GET /health health endpoint -
GET /status status of the application and chain include_chain (bool, optional) - when true, returns chain status
did:3:kjzl6cwe1jw14az1nu6usezgcqk16os0vzjzw6nheicts4jt0sp7yld8pv2cqj1

Hello World

This is a UI test description

Introduction

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Key Considerations

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.

@dgamboa
dgamboa / gist:4043195
Created November 9, 2012 01:44 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@dgamboa
dgamboa / Base File.sublime-settings
Created November 8, 2012 19:05 — forked from jaredatron/Base File.sublime-settings
Default (OSX).sublime-keymap
{
"word_wrap": false,
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme",
"font_size": 13.0,
"tab_size": 2,
"detect_indentation": false,
"translate_tabs_to_spaces": true,
"save_on_focus_lost": true,
// "draw_white_space": "all",
"trim_trailing_white_space_on_save": true,
### Ancient Roman Numerals
def to_roman(integer, numeral="")
return numeral if integer == 0
if integer/1000 >= 1
numeral << 'M' * ( integer/1000 )
remainder = integer % 1000
elsif integer/500 >= 1
numeral << 'D' * ( integer/500 )
@dgamboa
dgamboa / ruby_attributes_objects.md
Created October 4, 2012 20:41
In Ruby, is the attribute of an object an object?

###In Ruby, is the attribute of an object an object?

To illustrate, let's define a Book class where each book (or each instance of Book) has an author.

class Book
  attr_accessor :author

  def author
 @author
rvm list
~ dgamboa$ rvm list
rvm rubies
ruby-1.8.7-p370 [ i686 ]
ruby-1.9.2-p320 [ x86_64 ]
=* ruby-1.9.3-p194 [ x86_64 ]

Testing the speed of different RPN Calculator approaches

The following table shows the speed results of six different approaches to creating a reverse polish notation calculator with Ruby. The code was written by five different incoming Dev Bootcamp students and one instructor.

Approach Time (ms)
First 119.2
Second 295.6
Third 264.7
Fourth 274.3
@dgamboa
dgamboa / RPN.rb
Created September 7, 2012 16:03
Reverse Polish Notation Calculator
# The following method will take strings like '5 4 +', '-1', '5 -3 4 + 6 9 - * +', and '2 3 4 7 + * -', and return the result of running the calculation.
# Note: when performing division it will always round down.
def evaluate(string)
return string.to_i unless string.include?(' ')
string.match /(-?\d+) (-?\d+) ([-+*\/])(?!\d)/
result = ($1.to_i).send($3,$2.to_i)
string.gsub!($1 + ' ' + $2 + ' ' + $3, result.to_s)
evaluate(string)
end