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
Deployment steps: | |
git pull | |
cd smartschool | |
npm run-script build | |
cd .. | |
./gradlew bootRun | |
--------- | |
Build and run jar: | |
./gradlew build |
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
# File path: /etc/nginx/sites-available/default | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /home/ubuntu/ProjectBravo/smartschool/dist; | |
location /api { | |
proxy_redirect off; | |
proxy_pass http://localhost:8080; |
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
git init | |
//create .gitignore | |
git remote add origin https://github.com/userName/projectName.git | |
git add . | |
git commit -m "Commit name" | |
git pull origin master | |
git push origin master | |
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
function fib(n){ | |
if(n > 1){ | |
return fib(n-1)+fib(n-2); | |
} | |
else if(n == 0){ | |
return 0; | |
} | |
else if(n == 1){ | |
return 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
function factorial(n){ | |
var res = 1; | |
for(var i = 1; i <= n; i++){ | |
res *= i; | |
} | |
return res; | |
} |
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
function fact(n){ | |
if(n != 1) | |
return fact(n-1)*n | |
else | |
return 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
function sumTo(n) { | |
return (1 + n) * n / 2; | |
} |
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
function sumTo(n){ | |
rez = 0; | |
for(var i = 0; i <= n; i++){ | |
rez += i; | |
} | |
return rez; | |
} |
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
function sumTo(n){ | |
if(n != 1){ | |
return n + sumTo(n-1); | |
} | |
else{ | |
return 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
public static int[] insertElementIntoArray(int arr[], int position, int elem){ | |
int[] tempArr = new int[arr.length+1]; | |
for (int i = 0; i < position; i++) { | |
tempArr[i] = arr[i]; | |
} | |
tempArr[position] = elem; | |
for (int i = position+1; i < tempArr.length; i++) { | |
tempArr[i] = arr[i-1]; |
NewerOlder