Can Code | Can't Code | |
---|---|---|
Loves Coding | Yes | N/A |
Hates Coding | Maybe | No |
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
# gem 'wrest' in Gemfile | |
# optionally, `Wrest.logger = Rails.logger` in `config/initializers/wrest.rb` | |
module OpenAI | |
def self.base_uri | |
'https://api.openai.com/v1'.to_uri( | |
default_headers: { | |
'Content-Type' => 'application/json', | |
'Authorization' => "Bearer #{ENV.fetch('OPENAI_KEY', nil)}" |
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 '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]) |
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 'net/http' | |
module Net | |
class HTTP | |
def self.enable_debug! | |
raise "You don't want to do this in anything but development mode!" unless Rails.env == 'development' | |
class << self | |
alias_method :__new__, :new | |
def new(*args, &blk) | |
instance = __new__(*args, &blk) | |
instance.set_debug_output($stderr) |
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
From: https://raw.github.com/gist/933cc4f7df97d553ed89/24386c6a79bb4b31fb818b70b34c5eab7f12e1ff/gistfile1.txt | |
Stevey's Google Platforms Rant | |
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it. | |
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various effort |
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
// We're going to pick on Mad Service today. If you had a hand in writing this once upon a time, do not fret. | |
// This isn't accusation or finger-poiniting -- I see everyone's name all over this code, including my own, which | |
// makes it a nice target. | |
// This code just needs some tenderness. Let's cook it a hot bowl of soup and play some soft Jazz. | |
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
type Operation struct { | |
timeValue time.Time | |
s2IDLevel int64 | |
s2ID int64 | |
// ... | |
// ... | |
} | |
func (op operation) Perform() error { | |
surgeRepository := repository.NewSurgeRepository() |
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
type Operation struct { | |
timeValue time.Time | |
s2IDLevel int64 | |
s2ID int64 | |
// ... | |
// ... | |
} | |
func (op operation) Perform(surgeRepository repository.SurgeRepository) error { | |
// ... |
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
type Operation struct { | |
timeValue time.Time | |
s2IDLevel int64 | |
s2ID int64 | |
// ... | |
// ... | |
} | |
func (op operation) Perform(surgeRepository repository.SurgeRepository) error { | |
// ... |
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
Problem: Why should I get out of bed? | |
Answer: Because I need to work to support the people I care about. This includes your own time (to spend with them), food, housing, simple luxuries and top-notch healthcare. I personally need between two and five crores in today's money in the bank for this. (INR Five crores == USD ~1 million). | |
Problem: Ok, you've made that much money. Now why should you get out of bed? | |
Answer: Well, now it's just your own fulfillment. Boredom is the enemy. Why think small? Cure death. Produce unlimited energy. | |
Problem: But this takes resources. |
NewerOlder