This file contains hidden or 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 scoring | |
@heat = Heat.find(params[:heat_id]) | |
@judge = current_user | |
@event = Event.find(params[:event_id]) | |
# {st_id => [team#, [team, member, names]]} | |
@team_info = ScheduledTeam.eager_load( | |
heat: { | |
score_system: :score_terms, | |
scheduled_teams: { | |
registered_team: { |
This file contains hidden or 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
# gets combinations of coinage for your change | |
# makes sure not to repeat combos by using skip_list | |
# generates partial solutions using partial_list | |
# when value is reached, partial_list is stuffed into final_list | |
def spare_a_dime_brotha(money, global_skip_list, global_partial_list, final_list): | |
# make copies local to the scope | |
partial_list = global_partial_list[:] | |
skip_list = global_skip_list[:] | |
This file contains hidden or 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
# Andrew Hoyle | |
# converts a +/- integer to its American English equivalent | |
# includes basic exceptions | |
# PRE: less than | 1 quintillion | and +/- integer | |
# allows only numbers, commas, and '+' or '-' in idx[0] | |
# POST: American English translation of number | |
class Worder | |
# AM. ENGLISH |
This file contains hidden or 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
# mixes in logic to make a model understand how to fetch its relationships | |
# based on the item_id/item_item_type field combination | |
module VariadicItem | |
extend ActiveSupport::Concern | |
included do | |
belongs_to :item_type | |
end | |
# get the item associated with the current polymorphic record into which this module has been mixed |
This file contains hidden or 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
<% @comments.each do |comment_hash| %> | |
<%= render 'comment_tree', comment_hash: comment_hash %> | |
<% end %> |
This file contains hidden or 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 ( | |
"runtime/pprof" | |
"fmt" | |
"net/http" | |
"os" | |
"time" | |
) |
This file contains hidden or 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" | |
"net/http" | |
"github.com/gorilla/context" | |
"github.com/gorilla/mux" | |
"github.com/terryh/gopdf" |
This file contains hidden or 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
<h1>{{.Stuff}} is really neato!</h2> |
This file contains hidden or 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
{ | |
"who": "mettledrum", | |
"age": 31, | |
"fav_beers": | |
[ | |
{ | |
"name": "hot pepper", | |
"abv": 5.2, | |
"is_good": false | |
}, |
This file contains hidden or 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" | |
"os" | |
"os/signal" | |
"syscall" | |
"time" | |
) |
OlderNewer