Skip to content

Instantly share code, notes, and snippets.

Questions for Mat!

We have been creating an API using Serverless.com

Here is an example of our Serverless config file

service: hello-self-member-api

provider:
  name: aws
person = input('Enter your name: ')
print('Hello', person)
while True:
response = input("I'm meeting Dave and Emma for pizza on Friday. Would you like to come, " + person + "?\n")
if response == "yes":
print("great! See you there")
break
const express = require('express');
const router = express.Router();
const script = {
"setup": {
"initial_stage_id": "0",
"initial_scores": {
"money": 0,
"tomatoes": 0,
@asmt3
asmt3 / addClasses.js
Created December 8, 2016 09:42
Add classes to elements matching a certain CSS selector in jQuery
$(function(){
var selector = '.some-class';
$(selector).each(function(){
var $element = $(this);
$element.addClass('some-other-class')
$element.addClass('and-another-class')
})
@asmt3
asmt3 / backupGenerator.sh
Created November 16, 2016 13:36
Script to do regular MySQL backup on TSO Hosts
#!/bin/bash
#Database login credentials - need to be changed accordingly
dbHost="***"
dbName="**"
dbUser="***"
dbPass="***"
#How many days the backups should be kept for before being removed
keepBackupsFor="30"
app.directive('ggchrome', ['$http', '$q', '$timeout',
function($http, $q, $timeout) {
return {
link: function(scope, element, attr) {
var chromeBase = 'https://chrome.justgiving.com/clientonly/';
var container = element;
var footer = '';
var headcontent = '';
@asmt3
asmt3 / Vagrantfile
Created September 2, 2016 12:29
A Vagrant provisioning script to create an environment for Nginx/Node/Express/MySQL
# VAGRANTFILE_API_VERSION = "2"
# VAGRANT_DOMAIN_NAME = "dev.xmas.justgiving.com"
# VAGRANT_IP_ADDRESS = "192.168.33.62"
# Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# config.vm.box = "hashicorp/precise64"
# config.hostmanager.enabled = true
# config.hostmanager.manage_host = true