Skip to content

Instantly share code, notes, and snippets.

@kseniya292
kseniya292 / romannumeralconverter.js
Created July 24, 2016 15:01
Roman Numeral Converter Algorithm- freeCodeCamp
function convertToRoman(num) {
var romanArray = [];
while (num <= 3999 && num > 0) {
if (num >= 1000 && num <= 3999) {
romanArray.push("M");
@kseniya292
kseniya292 / whereforartthou.js
Last active July 24, 2016 15:02
Where For Art Thou Algorithm- freeCodeCamp
function whatIsInAName(collection, source) {
var arr = [];
for (var i = 0; i < collection.length; i++) {
var collectionObject = collection[i];
//console.log(collectionObject);
//loop through collection array to look at the objects. Put the collection objects into a variable called collectionObject
var perfectMatch = true;
//set this variable to true. This will be changed to false when next loop fails.
module.exports = {
attributes: {
from: {
type: 'string'
},
to: {
type: 'string'
},
name: {
module.exports = {
create: function (req, res) {
const email = req.body
sails.hooks.email.send(
"sendEmail",
{
Name: email.name,
},
{
<form>
<md-input-container>
<input mdInput type="text" class="form-control"
required
name="name" #name placeholder="name">
</md-input-container>
<md-input-container>
<input mdInput type="email" class="form-control"
required
name="email" #email placeholder="email">
onSubmit(name, email, message) {
this._emailService.sendEmail({
from: 'Mailgun Sandbox <postmaster@sandboxXXXXXXXXXXXXXXXXXXXXX.mailgun.org>',
to: email,
name: name,
text: message,
})
.subscribe(
() => {},
err => console.log(err)
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
@Injectable()
export class EmailService {
constructor(private http: Http) { }
sendEmail(data) {
module.exports.email = {
service: "Mailgun",
auth: {
user: "postmaster@sandboxXXXXXXXXXXXXXXXXXXXXX.mailgun.org",
pass: "XXXXXXXXXXXXXXXXXXXXX"
},
from: "email@your-domain",
templateDir: "views/emailTemplates",
testMode: false
}
export class AppModule {
public constructor(
private readonly transferState: TransferState,
private readonly store: Store<fromRoot.State>,
) {
const isBrowser = this.transferState.hasKey<any>(NGRX_STATE);
if (isBrowser) {
this.onBrowser();
} else {
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router';
import { ProgressService } from '../progress.service';
import { PatientService } from '../../patient.service';
@Component({
selector: 'app-patient-info',
templateUrl: './patient-info.component.html',