This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| import { Knex } from 'knex' | |
| export async function up(knex: Knex): Promise<any> { | |
| await knex.schema.createTable('test_setup', (table: Knex.TableBuilder) => { | |
| table.integer('foobar'); | |
| }); | |
| } | |
| export async function down(knex: Knex): Promise<any> { | |
| await knex.schema.dropTable('test_setup'); |
This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.
To learn more about migrations, check out this article on the different types of database migrations!
rebase vs merge).rebase vs merge)reset vs checkout vs revert)git rev-parse)pull vs fetch)stash vs branch)reset vs checkout vs revert)| const axios = require('axios'); | |
| const http = require('http'); | |
| const https = require('https'); | |
| module.exports = axios.create({ | |
| //60 sec timeout | |
| timeout: 60000, | |
| //keepAlive pools and reuses TCP connections, so it's faster | |
| httpAgent: new http.Agent({ keepAlive: true }), |
1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv to manually rebuild the font cache
This vanilla ES6 function async allows code to yield (i.e. await) the asynchronous result of any Promise within. The usage is almost identical to ES7's async/await keywords.
async/await control flow is promising because it allows the programmer to reason linearly about complex asynchronous code. It also has the benefit of unifying traditionally disparate synchronous and asynchronous error handling code into one try/catch block.
This is expository code for the purpose of learning ES6. It is not 100% robust. If you want to use this style of code in the real world you might want to explore a well-tested library like co, task.js or use async/await with Babel. Also take a look at the official async/await draft section on desugaring.
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would