Skip to content

Instantly share code, notes, and snippets.

View aman-gautam's full-sized avatar
💭
Building Products... Always Learning!

Aman Gautam aman-gautam

💭
Building Products... Always Learning!
View GitHub Profile
function parseTime(str) {
const matches = str.match(/([0-9])\w*:([0-9])\w*/g);
matches.forEach(match => {
const split = match.split(':')
const seconds = parseInt(split[0]) * 60 + parseInt(split[1]);
console.log(match);
str = str.replaceAll(match, `<a href="https://youtu.be/I-A74HbCyK4?t=${seconds}">${match}</a>`)
})
return str;
}
@aman-gautam
aman-gautam / notion2blog.js
Created August 4, 2022 15:35 — forked from mayneyao/notion2blog.js
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@aman-gautam
aman-gautam / script.sql
Created August 2, 2021 16:11
SQL for inserting timezones in postgres
INSERT into timezone ("name", "alternativeName", "group", "continentCode", "continentName", "countryName", "countryCode", "mainCities", "rawOffsetInMinutes", "abbreviation", "rawFormat", "currentTimeOffsetInMinutes", "currentTimeFormat")
VALUES
('Pacific/Niue',
'Niue Time',
'[]',
'OC',
'Oceania',
'Niue',
@aman-gautam
aman-gautam / angular-ionic-stars.html
Last active August 20, 2020 05:20
Ionic stars implementation. For some reason, many developers prefer the more complex packages, for simple use cases this is enough.
<!-- For a rating of 1 to 5 stars -->
<!-- Editable -->
<ion-item>
<ion-icon
*ngFor="let i of [1,2,3,4,5]"
(click)="value = i"
[color]="value < i? '': 'primary'"
[name]="value < i? 'star-outline': 'star'">
</ion-icon>
@aman-gautam
aman-gautam / Task.md
Last active April 6, 2018 08:27
Hiring Task for Developer @UXGorilla @ElpisDesign

Developer - Engineering Team

ElpisDesign LLP is a design-centered technology company. With our flagship product - UX Gorilla, which is in stealth mode, we are trying to make tech-products more usable. We also develop Enterprise SaaS products for our clients.

Our Tech Stack is:

  1. Javascript (ES6)
  2. Python (Django)
  3. Elasticsearch
@aman-gautam
aman-gautam / kibana-analytics.json
Created September 30, 2014 10:33
Kibana configuration for a sample Analytics over tender's data
{
"title": "Analytics",
"services": {
"query": {
"list": {
"0": {
"query": "*",
"alias": "",
"color": "#7EB26D",
"id": 0,