Skip to content

Instantly share code, notes, and snippets.

View gotjosh's full-sized avatar
🎯
Focusing

gotjosh gotjosh

🎯
Focusing
View GitHub Profile
@johannaratliff
johannaratliff / learning-golang.md
Last active April 9, 2024 20:07
Golang Rampup

Context

This is for programmers who want to ramp on Go, without resources that reiterate programming fundamentals. This would not be a good list of resources for folks who are learning to program using Go as their first language. Some resources that I dismiss here would be super valuable for newer folks. This is a selection of resources for those who understand programming fundamentals in a different language already.

Advice

  1. First steps = Tour of Go
  2. Don't waste time on Go Fundamentals-type books - it all lives in tour of Go.
  3. Consider joining the Gophers Slack
  4. When you need help, the Go Playground allows you make a quick scratch file and share it. Others trying to help can run your code easily this way.
@lawrencejones
lawrencejones / matrixMultiply.ast
Created November 24, 2017 16:53
Matrix multiplication AST from Wacc source code
Program
[]
[ Declare
(ArrayType (ArrayType (Type "int")))
(Ident "A")
(ArrayLit
[ ArrayLit [ Unary (Op "-") (IntLit 2) , IntLit 5 ]
, ArrayLit [ IntLit 3 , IntLit 7 ]
])
, Declare
@gmodarelli
gmodarelli / pre-commit
Last active December 7, 2021 11:20
RuboCop with git pre-commit
#!/bin/sh
#
# Check for ruby style errors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
NC='\033[0m'
if git rev-parse --verify HEAD >/dev/null 2>&1

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@abdullin
abdullin / ddd-in-golang.markdown
Last active October 10, 2023 00:46
DDD in golang

This is my response to an email asking about Domain-Driven Design in golang project.

Thank you for getting in touch. Below you will find my thoughts on how golang works with DDD, changing it. This is merely a perception of how things worked out for us in a single project.

That project has a relatively well-known domain. My colleagues on this project are very knowledgeable, thoughtful and invested in quality design. The story spelled out below is a result of countless hours spent discussing and refining the approach.

Conclusions could be very different, if there was a different project, team or a story-teller.

Short story

@iHiD
iHiD / config.rb
Last active June 10, 2017 15:05
Baruco 2014 Live Coding Talk on Propono.
require 'propono'
Propono.config do |config|
config.access_key = "AKIAIPE2MSOM5ZFGQBCQ"
config.secret_key = "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"
config.queue_region = "eu-west-1"
end
require 'twitter'
@twitter = Twitter::REST::Client.new do |config|
config.consumer_key = "OG9Zkag09onRe7b5ZLecO7HGb"
@jodosha
jodosha / gist:ade11746700fe23cd4f2
Last active August 29, 2015 14:01
Lotus application structure
# app/
# controllers/
# dashboard_controller.rb DashboardController::Index or Controllers::Dashboard::Index
# identity_controller.rb IdentityController::Edit|Update or Controllers::Identity::Edit|Update
# sessions_controller.rb SessionsController::New|Create|Destroy or Controllers::Sessions::New|Create|Destroy
# entities/
# account.rb Account
# identity.rb Identity
# person.rb Person
# interactors/
@jodosha
jodosha / Gemfile
Last active December 9, 2020 15:09
Full stack Lotus application example
source 'https://rubygems.org'
gem 'rake'
gem 'lotus-router'
gem 'lotus-controller'
gem 'lotus-view'
group :test do
gem 'rspec'
gem 'capybara'
# MODEL
class Case < ActiveRecord::Base
include Eventable
has_many :tasks
concerning :Assignment do
def assign_to(new_owner:, details:)
transaction do
@BiggerNoise
BiggerNoise / assign_case_command.rb
Created March 3, 2014 21:10
Command Pattern at work
class AssignCaseCommand < Command
attribute :case, Case
attribute :owner, User
attribute :created_by, User
attribute :comments, String
attribute :distribute_at, DateTime
attribute :distribute_rule_name, String
attribute :require_initial, Boolean