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
server { | |
listen 80; | |
server_name CHANGEME.app; | |
root /var/www/vhosts/CHANGEME.app/public; | |
index index.html index.htm index.php; | |
charset utf-8; | |
location / { |
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
<?php | |
//1) Preferred | |
"text {$array['name']} more text"; // associative single | |
"text $array[2] more text"; // numeric single | |
"text $object->name $object->price more text"; // property | |
//2) Valid alternatives | |
"text $array[name] more text"; // associative single | |
"text {$array[2]} more text"; // numeric single |
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
struct Vertex | |
property id, edges | |
def initialize(@id : Int32) | |
@edges = Hash(Pointer(Vertex), Float64).new | |
end | |
end | |
def find(graph : Array(Pointer(Vertex)), start : Pointer(Vertex), end : Pointer(Vertex)) | |
dist = {} of Pointer(Vertex) => Float64 # Distances | |
prev = {} of Pointer(Vertex) => Pointer(Vertex) # Path |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define TABLE_SIZE 100 | |
#define WORD_SIZE 100 | |
struct node { | |
char * key; | |
int value; |
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 <cstdio> | |
#include <iostream> | |
using namespace std; | |
inline int char_to_index(char c) { return c - 'a'; } | |
inline char index_to_char(int index) { return 'a' + index; } | |
int main(void) { | |
int vertices_number = 0, edges_number = 0, test_case_number = 5; |
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> | |
struct node { | |
int rank; | |
char data; | |
struct node* parent; | |
}; | |
struct node* create_node(char data); |
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 <cmath> | |
#include <iostream> | |
#include <queue> | |
#include <iomanip> | |
using namespace std; | |
typedef pair<int, int> coords; | |
inline double vector__length(coords pos) { |
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
package main | |
import ( | |
"database/sql" | |
"encoding/json" | |
"fmt" | |
"log" | |
_ "github.com/go-sql-driver/mysql" | |
) |
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 ruby:alpine | |
# Minimal requirements to run a Rails app | |
RUN apk add --no-cache --update build-base \ | |
linux-headers \ | |
git \ | |
postgresql-dev \ | |
tzdata \ | |
nodejs |
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 joaofnds/rails-alpine as builder | |
RUN mkdir /app | |
WORKDIR /app | |
COPY Gemfile Gemfile.lock /app/ | |
RUN bundle install | |
FROM joaofnds/rails-alpine | |
RUN mkdir /app | |
WORKDIR /app | |
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/ |
OlderNewer