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 node:20-alpine AS build | |
RUN apk update && apk add curl libcurl | |
RUN mkdir -p /home/node/app/node_modules | |
WORKDIR /home/node/app | |
COPY package*.json ./ | |
RUN npm install |
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
# Ignore artifacts: | |
build | |
coverage |
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
import * as repl from 'repl' | |
import * as path from 'path' | |
import * as fs from 'fs' | |
/* | |
* Helpers | |
*/ | |
/* | |
* Reload modules clearing caches and requiring them again. |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <unistd.h> | |
int main(void) { | |
struct sockaddr_in server_address; /* address of the server */ | |
int client_socket; /* FD of socket to connect with servers */ |
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 elixir:1.10.4 | |
## | |
# Install system dependencies & tooling | |
## | |
RUN apt-get update | |
RUN apt-get -y upgrade | |
RUN apt-get install -y bash curl apt-utils build-essential inotify-tools |
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
/* | |
* 1. Create a sample table to store our bookings: | |
*/ | |
> CREATE TABLE bookings (id INT, scheduled_date DATE, start_time TIMESTAMP, end_time TIMESTAMP, timezone_id VARCHAR(40)) | |
> \d bookings | |
-- +----------------+-----------------------------+-------------+ | |
-- | Column | Type | Modifiers | | |
-- |----------------+-----------------------------+-------------| |
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
## | |
# Implementation | |
## | |
# config/config.exs | |
config :my_app, :kv_store_adapter, KVStore | |
defmodule KVStore do | |
#... | |
end |
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
# Configuration for Alacritty, the GPU enhanced terminal emulator. | |
# Any items in the `env` entry below will be added as | |
# environment variables. Some entries may override variables | |
# set by alacritty itself. | |
# env: | |
# TERM variable | |
# | |
# This value is used to set the `$TERM` environment variable for | |
# each instance of Alacritty. If it is not present, alacritty will |
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
# An usual class is a subclass of object | |
class Human(object): | |
# Defining class variables | |
species = "H. Sapiens" | |
def __init__(self, first_name, last_name): | |
# Assign instance variables (also called attributes): | |
self.__internal = "secret" # Private attribute (externally accessed via: human._Human_internal) | |
self.first_name = first_name # Public attribute (externally accessed via human.first_name) | |
self.last_name = last_name # Since last_name has not a getter/setter below |
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 Query { | |
allPersons(last: Int): [Person!]! | |
} | |
type Mutation { | |
createPerson(name: String!, age: Int!): Person! | |
} | |
type Subscription { | |
newPerson: Person! |
NewerOlder