Skip to content

Instantly share code, notes, and snippets.

View English3000's full-sized avatar

English3000

View GitHub Profile
@English3000
English3000 / 2018-01-19-sa.md
Last active January 20, 2019 07:53
Forking Elixir; First Impressions

When Elixir 1.8 was released, I wrote an article sharing my thoughts. Unfortunately, they didn't gain enough traction...

The great thing about tech is you don't need someone else's buy-in to run with your own idea.

So I forked.


The next step was to open it my editor. When I inspected elixir/lib, I saw 6 subdirectories. It turns out they are all independent Mix packages. (Notably, elixir--the root directory--has no mix.exs)

@English3000
English3000 / beginnerS-go.md
Last active February 3, 2018 05:57
Beginner's Go

I discovered Go during my job search. Some companies had listed it in their stacks, and I heard back from one of them, so I did my due diligence. In a nutshell, Go was built to (1) mimic C++ functionality with cleaner syntax, and (2) leverage modern multi-core processors in computers. For the latter, this means that because processors are multi-core, they can perform operations on parallel threads (known in Go as concurrency). Combined with performance optimizations possible when using a static-typed language, Go can perform 10 times more efficiently than a dynamically-typed language like Ruby on Rails.

My Review

Go, at first, seems really appealing to learn as a first statically-typed language. The tour provides a clear introduction to the syntax and Go's special equals operator := makes coding in it feel like a dynamically-typed language. Add in an amazing linter in go-plus and at first Go seems really exciting and educational. Furthermore, after finishing

@English3000
English3000 / state-shape-and-sql.md
Last active December 17, 2017 00:12
State Shape and SQL

When building an app, there's a frontend and a backend. Under the React framework/library, a frontend consists of a hierarchy of components. The frontend is built with HTML, CSS, JavaScript, and JSX. The HTML is for a static page which components will be rendered on. Components are built in JSX.

When you have your hierarchy built and styling set, you can then give components access to data from your backend. My background is with Ruby on Rails, but almost any backend will use some sort of structured-query language to make requests to its database.

The data returned then gets filtered through reducer files into a data structure called the state. Under Redux, state is unidirectional (the frontend can't modify state on its own; the state is modified through responses to API/AJAX requests).

The state is an object version of a SQL table. The state has slices, top-level key-value pairs.

Your AJAX request has a payload. The payload includes routing information, as well as instructions to the controller for which action to execute. Whichever action is executed either creates or does something with an existing instance of a model (a row in a table in your database server).

Once what's done has been done as your action is executed, Rails sends the result to a view. A view is either an HTML template or a JSON object (key-value pairs). This template/view takes in the model data. Voila! There's the unique info that's put on your webpage.

So the controller executes an action, then sends the result into the view. That view plus model data is the response that is sent back and which renders on your browser.

To do all that, you need to know HTML, CSS, JavaScript (the jQuery library has a built-in $.ajax() method--see the Examples at the bottom for the syntax of the payload object), Ruby (or another server-side scripting language), and Rails' Active Record or

JavaScript sends the request from the client to the server. A request can be sent simply by clicking on a button. Research JavaScript for yourself to discover how; but that's one main thing it is for.

So your request goes to the router, which directs it to a controller. Welcome to the backend!

App Academy teaches Ruby--

a server-side scripting language, or a coding language you use to write scripts--text files with .rb extensions--for your backend server of your website you've coded

--on Rails--

CLIENT. SERVER. DATABASE.

Client-side: HTML, CSS, plus JavaScript to access the server.

Okay, before I go over MVC (Model-View-Controller)...

JavaScript

They (at App Academy) tell us that all companies use it. They say it's a must-have for the job market. And from my experience searching online, I did not find a source that explains well what it does.

Where do I get started? That's the question I'd start with.

I know what I know from two sources: App Academy and Codecademy. App Academy is an intensive coding bootcamp one applies for. Codecademy is a free online resource.

I'd describe them as such: If you've learned a new language in school, Codecademy is like learning some common vocabulary and the general grammatical structure. App Academy is like going to a country where the language is spoken natively, and receiving lessons along with going out and just conversing.

Backtracking, I do not have a technical background--i.e. my schools did not require or emphasize coding in their curricula, and I did not study computer science in undergrad. I gained an interest in the tech industry as a result of doing tasks in past positions as efficiently as I could, finding that my pace of work outpaced that which the organization could provide me new work. So one appeal of tech for me was receiving