This file contains hidden or 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
'use strict'; | |
const express = require('express'); | |
const { Appsignal } = require('@appsignal/nodejs'); | |
// Constants | |
const PORT = 8080; | |
const HOST = '0.0.0.0'; |
This file contains hidden or 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
Question: | |
You are required to write a program to sort the (name, age, height) tuples by ascending order where name is string, age and height are numbers. The tuples are input by console. The sort criteria is: | |
1: Sort based on name; | |
2: Then sort based on age; | |
3: Then sort by score. | |
The priority is that name > age > score. | |
If the following tuples are given as input to the program: | |
Tom,19,80 | |
John,20,90 | |
Jony,17,91 |
This file contains hidden or 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
kubectl create -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/examples/deployment/default-backend.yaml | |
kubectl create -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/examples/deployment/nginx-ingress-controller.yaml | |
kubectl run ingress-pod --image=nginx --port 80 | |
kubectl expose deployment ingress-pod --port=80 --target-port=80 --type=NodePort | |
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
name: ingress-service |
- Download all dependencies from by following the documentation https://docs.docker.com/engine/installation/linux/docker-ce/centos/#install-using-the-repository
yumdownloader --resolve yum-utils device-mapper-persistent-data lvm2
yumdownloader --resolve docker-ce
- Copy to master node and install afterwards:
yum install -y *.rpm
This file contains hidden or 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
> curl -H "Origin: http://example.com" \ | |
> -H "Access-Control-Request-Method: POST" \ | |
> -H "Access-Control-Request-Headers: X-Requested-With" \ | |
> -X OPTIONS --verbose \ | |
> https://api.keyvalue.xyz | |
* Rebuilt URL to: https://api.keyvalue.xyz/ | |
* Trying 104.31.80.22... | |
* TCP_NODELAY set | |
* Connected to api.keyvalue.xyz (104.31.80.22) port 443 (#0) | |
* TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 |
This file contains hidden or 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
test |
This file contains hidden or 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
#define $(i, f) \ | |
({ int _temp = 0; \ | |
int _size = sizeof(i) / sizeof(typeof((*i))); \ | |
do { \ | |
(lambda(void, (typeof((*i)) _ ) {f;} ))( *(i+_temp) ); \ | |
} while( ++_temp < _size ); \ | |
}); |
This file contains hidden or 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
# Developer ilanı | |
if (education.related("Computer Science") && knowledge.computerScience.level == high) { | |
applyJob("Developer") | |
} | |
# Guardian of Excellence | |
if(reasoning.level == "Spock") | |
applyJob("Guardian of Excellence") |
This file contains hidden or 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
public static String clearTurkishChars(String str) { | |
String ret = str; | |
char[] turkishChars = new char[] {0x131, 0x130, 0xFC, 0xDC, 0xF6, 0xD6, 0x15F, 0x15E, 0xE7, 0xC7, 0x11F, 0x11E}; | |
char[] englishChars = new char[] {'i', 'I', 'u', 'U', 'o', 'O', 's', 'S', 'c', 'C', 'g', 'G'}; | |
for (int i = 0; i < turkishChars.length; i++) { | |
ret = ret.replaceAll(new String(new char[]{turkishChars[i]}), new String(new char[]{englishChars[i]})); | |
} | |
return ret; | |
} |