- Syntax
- for-of-Loop
- const vs let
- Spread-Syntax (
...
) - Optional Chaining (
?.
) - Nullish Coalescing Operator (
??
) - Arrow-Functions
- Destructuring Assignment
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 php:7.3.0-apache | |
COPY . /var/www/html/ | |
WORKDIR /var/www/html |
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
class MapOfComplexData< | |
Key, | |
Value, | |
HashFn extends (key: Key) => number = (key: Key) => number, | |
EqualsFn extends (objA: Key, objB: Key) => boolean = (objA: Key, objB: Key) => boolean | |
> { | |
private _data = new Map<number, {key: Key; value: Value}[]>(); | |
private _size: number = 0; | |
private hashCode: HashFn; | |
private equals: EqualsFn; |
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 Employee = { | |
canWalkVeryFast: boolean; | |
numberOfKeystrokes: number; | |
isNiceToTheBoss: "yes" | "no" | "sometimes"; | |
}; | |
function foobar<T extends keyof Employee>(key: T, value: Employee[T]) { | |
console.log(key, 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
Option Explicit | |
Sub IntersectionMacro() | |
Dim set1 As New Scripting.Dictionary | |
Dim set2 As New Scripting.Dictionary | |
Dim result As New Scripting.Dictionary | |
set1.Add "M AB 123", "" | |
set1.Add "M CD 456", "" |
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 docplex.mp.model import Model | |
m = Model("test") | |
a = m.binary_var(name="a") | |
b = m.binary_var(name="b") | |
c = m.binary_var(name="c") | |
m.add_constraint(m.logical_and(a, b) == c) | |
m.add_constraint(a == 1) |
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 ortools.sat.python import cp_model | |
COUNTS = 10 | |
MIN_VAL = 2 | |
MAX_VAL = 4 | |
class Slot: | |
def __init__(self,model): | |
self.model = model | |
self.start = model.NewIntVar(-1,COUNTS-1,name="")#inclusive |
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
const arr = [1,1,0,0,1,1,1,0,1]; | |
function sumConsecutiveOnes(arr) { | |
return [...arr, 0].reduce((acc, value) => { | |
if(value === 1) { | |
acc.counter += 1; | |
} else if(acc.counter > 0) { | |
acc.output.push(acc.counter); | |
acc.counter = 0; | |
} |
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 java.nio.charset.StandardCharsets; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.Arrays; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
public class RemoveAllTest { | |
public static void main(String[] args) { |
This guide is mainly based on Arch's wiki, with some additions:
- I couldn't upgrade the database because the upgrade tool needs the
postgis-2.4.so
file - The created cluster could not be used to upgrade from the old data because the locale was set to 'C' (needed to add
--locale=en_US.UTF-8
) - The upgrade tool checks if the the new postgresql installation has a compatible postgis version. That means we need postgis 2.4 for postgresql 11. Unfortunately, we cannot install it over the package manager, instead we need to compile it from source.
# Stop currently running server
systemctl stop postgresql.service
# Install new packages
NewerOlder