Skip to content

Instantly share code, notes, and snippets.

View faithgaiciumia's full-sized avatar
💭
online

Faith Gaiciumia Kamencu faithgaiciumia

💭
online
View GitHub Profile
@faithgaiciumia
faithgaiciumia / main.dart
Last active February 10, 2020 05:24
Send Greetings
void main() {
String username = "Kuria";
print ( sendGreeting(username));
}
String sendGreeting(username){
var friendsList = [
"Moses",
"Kuria",
"Uket",
"Regina",
@faithgaiciumia
faithgaiciumia / main.dart
Last active February 11, 2020 09:59
Compute wages using hourly rate and hours worked.
void main() {
double hourlyRate = -0.5;
int hoursWorked = 12;
print(computeWages(hourlyRate , hoursWorked));
}
computeWages (hourlyRate , hoursWorked) {
var wages = hourlyRate * hoursWorked;
if(hourlyRate<=0||hoursWorked<=0){
throw('Negative values not allowed');
}
(function(){}());
(function () {
const quotes = [
{ quote: "You're only as sick as your secrets.", author: "Anonymous" },
{
quote: "To remain young one must change.",
author: "Alexander Chase",
},
{
quote:
"Those who seek happiness miss it, and those who discuss it, lack it.",
<!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" />
<link
href="https://fonts.googleapis.com/css2?family=Cookie&display=swap"
rel="stylesheet"
/>
html {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: #2d3436;
background-image: linear-gradient(315deg, #2d3436 0%, #000000 74%);
}
#quote-box {
width: 60vw;
function generateQuote() {
var randomIndex = Math.floor(Math.random()*quotes.length);
document.getElementById("quote").innerHTML=quotes[randomIndex].quote;
document.getElementById("author").innerHTML="~"+ " " + quotes[randomIndex].author;
}
@faithgaiciumia
faithgaiciumia / completedApp.js
Created June 29, 2020 21:42
Complete app.js
const quotes = [
{ quote: "You're only as sick as your secrets.", author: "Anonymous" },
{
quote: "To remain young one must change.",
author: "Alexander Chase",
},
{
quote:
"Those who seek happiness miss it, and those who discuss it, lack it.",
author: "Holbrook Jackson",
var user = (
function (){
var name = "faith";
return name;
}
)();
name; //faith