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
pipeline{ | |
agent any | |
tools{ | |
nodejs 'Node-18' | |
} | |
environment { | |
MONGODB_URI = credentials('mongo-db') | |
DOCKER_IMAGE_NAME = 'app-gallery' | |
DOCKER_IMAGE_TAG = '1.0.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
/** | |
You are given a JSON object representing a part of your musical album collection. | |
Each album has several properties and a unique id number as its key. Not all albums have complete information. | |
Write a function which takes an album's id (like 2548), a property prop (like "artist" or "tracks"), | |
and a value (like "Addicted to Love") to modify the data in this collection. | |
If prop isn't "tracks" and value isn't empty (""), update or set the value for that record album's property. | |
Your function must always return the entire collection object. |
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 rangeOfNumbers(startNum, endNum) { | |
if (endNum < startNum) { | |
return []; | |
} else { | |
var range = rangeOfNumbers(startNum, endNum - 1); | |
range.push(endNum); | |
return range; | |
} | |
}; |
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 class App { | |
public static void main(String[] args) { | |
ProcessBuilder process = new ProcessBuilder(); | |
Integer port; | |
// This tells our app that if Heroku sets a port for us, we need to use that port. | |
// Otherwise, if they do not, continue using port 4567. | |
if (process.environment().get("PORT") != null) { | |
port = Integer.parseInt(process.environment().get("PORT")); |
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 org.sql2o.*; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
public class DB { | |
private static URI dbUri; | |
public static Sql2o sql2o; | |
Logger logger = LoggerFactory.getLogger(DB.class); | |
static { |
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
apply plugin: 'java' | |
apply plugin: 'application' | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
compile 'com.sparkjava:spark-core:2.5.5' | |
compile 'org.slf4j:slf4j-simple:1.7.21' |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<title>Document</title> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<title>Document</title> |
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
// Calling in our dependencies | |
var gulp = require('gulp'), | |
concat = require('gulp-concat'), | |
uglify = require('gulp-uglify'), | |
// Browserify helps to bring node modules to browser. | |
browserify = require('browserify'), | |
/* | |
gulp uses a format called vinyl streams (https://github.com/gulpjs/vinyl) but browserify outputs text streams. We require vinyl-source-stream to convert text streams to vinyl streams. | |
*/ |
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 removeVowels(sentence) { | |
var vowels = ['a', 'e', 'i', 'o', 'u']; | |
var newSentence = []; | |
for (var i = 0; i < sentence.length; i++) { | |
if (vowels.includes(sentence[i])) { | |
newSentence.push('-'); | |
} else { | |
newSentence.push(sentence[i]); | |
} | |
} |
NewerOlder