Skip to content

Instantly share code, notes, and snippets.

View dottedsquirrel's full-sized avatar

Aphinya Dechalert dottedsquirrel

View GitHub Profile
(task time * duration without automation) - (time to automate * resource) = time profit
(5 [mins] * 90 [days] ) - (45 [mins] * 1 [dev]) = 405 mins time profit --> or 6 hours and 45 mins
(task time * duration without automation) - (time to automate * resource) = time profit
.nav ul {
background:#0d47a1;
padding:0;
}
.nav li {
width:100px;
position: relative;
display:inline-block;
<div class="nav">
<ul>
<li>
<a href="#">Item 1</a>
<ul>
<li>
<a href="#">Sub Item</a>
<ul>
<li><a href="#">2nd lvl sub item</a></li>
<li><a href="#">2nd lvl sub item</a></li>
@dottedsquirrel
dottedsquirrel / index.html
Created April 13, 2020 10:28
The Ultimate Drop Down Tutorial // source https://jsbin.com/zaxohuv
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>The Ultimate Drop Down Tutorial</title>
<style id="jsbin-css">
/* Text styling */
h1, h2, h3, h4, h5, h6, p, li { font-family: Arial; }
@dottedsquirrel
dottedsquirrel / Code.gs
Last active May 25, 2021 19:10
Code.gs - Spreedsheet to Magic API
/**
* Copyright 2019 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*/
function getEnvironment() {
var environment = {
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>",
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>"
};
@dottedsquirrel
dottedsquirrel / monthsSort.js
Created October 20, 2019 23:02
Using sort() on months
var someItems = ["Feb", "Jan", "Apr", "Dec", "Oct"];
function sortMonths(a, b){
var correctMonthsOrder = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
return correctMonthsOrder.indexOf(a) - correctMonthsOrder.indexOf(b);
}
someItems.sort(sortMonths);
@dottedsquirrel
dottedsquirrel / sortNumbers.js
Created October 20, 2019 22:22
sort() callback function
function sortNumbers(a, b) {
if (a > b) {
return 1;
} else if (b > a) {
return -1;
} else {
return 0;
}
}
{
bread: [
{name: 'ciabatta', cost: 2.00, price: 8.50, sold: 14},
{name: 'whole grain', cost: 1.59, price: 4.50, sold: 5}
],
drinks: {
cola: [
{name: 'Coca-cola', cost: 0.80, price: 2.99, sold:32},
{name: 'Pepsi', cost: 1.50, price: 2.99, sold:45}
],
{
bread: [
{name: 'ciabatta', cost: 2.00, price: 8.50, sold: 14},
{name: 'whole grain', cost: 1.59, price: 4.50, sold: 5}
],
drinks: {
cola: [
{name: 'Coca-cola', cost: 0.80, price: 2.99, sold:32},
{name: 'Pepsi', cost: 1.50, price: 2.99, sold:45}
],