Skip to content

Instantly share code, notes, and snippets.

View JanethL's full-sized avatar

Janeth Graziani JanethL

View GitHub Profile
@JanethL
JanethL / style.css
Last active June 27, 2021 18:38
Style.css page for tetris game
body {
background-image: url("https://i.ibb.co/YTN069M/tetris.jpg");
padding-top: 1em;
text-align: center;
background-size: cover;
}
h2,
h3,
h4 {
@JanethL
JanethL / index.html
Created June 27, 2021 17:03
index.html for Tetris game
<!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">
<title>Tetris Challenge</title>
<!--Import font -->
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P" rel="stylesheet">
@JanethL
JanethL / ChallengeProblem3.js
Last active June 13, 2021 18:02
Using Javascript Functions to Solve Challenge Problems with Autocode
/***********************************************************************
Write a function oddOnesOut(array) that takes in an array of strings and
returns a new array array containing only elements that appeared an even
number of times in the input array.
Examples:
const arr1 = ['a', 'b', 'b', 'c', 'd', 'c', 'c', 'd']
const arr2 = ['fish', 'fish', 'dog', 'cat', 'dog', 'dog']
oddOnesOut(arr2); // => [ 'fish' ]
***********************************************************************/
@JanethL
JanethL / ChallengeProblem1.js
Last active June 13, 2021 16:50
Using Javascript Functions to Solve Problems with Autocode
/***********************************************************************
Write a function greatestCommonFactor(num1, num2) that returns the
greatest common factor between num1 and num2. This means that the
function should return the largest number that divides both num1 and
num2.
Examples:
greatestCommonFactor(6, 10); // => 2
greatestCommonFactor(10, 15); // => 5
@JanethL
JanethL / ChallengeProblem2.js
Last active June 13, 2021 17:24
Learning Javascript Functions
/***********************************************************************
Write a function nickname(name) that takes in a name string and returns
a string representing their nickname. A nickname is the name up to the
second vowel repeated twice. See the examples.
Examples:
nickname('pikachu'); // => 'PIKA-PIKA'
nickname('engineer'); // => 'ENGI-ENGI'
nickname('bob'); // => 'BOB-BOB'
***********************************************************************/
const qrcode = require('qrcode');
/**
* Creates a QR Code for websites
* @param {string} url The URL for the website
* @returns {object.http} The QR Code image
*/
module.exports = async (url = 'url') => {
let result = await new Promise((resolve, reject) => {
@JanethL
JanethL / record.js
Last active May 4, 2020 20:36
Slash command to record members responses in Airtable
const lib = require('lib')({
token: process.env.STDLIB_SECRET_TOKEN
});
/**
* An HTTP endpoint that acts as a webhook for Slack command event
* @param {object} event
* @returns {object} result Your return value
*/
module.exports = async (event) => {
// Store API Responses
@JanethL
JanethL / weekly.js
Last active May 4, 2020 20:37
Scheduler API to kick off Slack messages to every Slack member listed in Airtable Spreadsheet
const lib = require('lib')({
token: process.env.STDLIB_SECRET_TOKEN
});
/**
* An HTTP endpoint that acts as a webhook for Scheduler daily event
* @returns {object} result Your return value
*/
module.exports = async () => {
@JanethL
JanethL / getmembers.js
Last active May 4, 2020 20:36
Slack Slash Command to Retrieve all Members in a Workspace and Store Data in Airtable
const lib = require('lib')({
token: process.env.STDLIB_SECRET_TOKEN
});
/**
* An HTTP endpoint that acts as a webhook for Slack command event
* @param {object} event
* @returns {object} result Your return value
*/
module.exports = async (event) => {
@JanethL
JanethL / scrape.js
Created April 7, 2020 19:24
Slack App Website Scraper on Autocode
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
/**
* An HTTP endpoint that acts as a webhook for Slack command event
* @param {object} event
* @returns {object} result Your return value
*/
module.exports = async (event) => {
// Store API Responses
const result = {slack: {}, crawler: {}};