Skip to content

Instantly share code, notes, and snippets.

View karngyan's full-sized avatar
🛌
working from my bed

Karn karngyan

🛌
working from my bed
View GitHub Profile
[
{
"name": "New Subscribers",
"description": "Users who have signed up within the last 7 days."
},
{
"name": "High Spenders",
"description": "Customers who have spent more than $500 in the last 30 days."
},
{
[
{
"name": "Order Confirmation",
"description": "A transactional email confirming that the user’s order has been placed successfully.",
"subject": "Your Order Confirmation",
"body": "<html><body><h1>Thank you for your order!</h1><p>Your order has been successfully placed. We will notify you when it ships.</p></body></html>"
},
{
"name": "Password Reset",
"description": "An email containing a link to reset the user’s password upon request.",
[
{
"name": "Holiday Sale Announcement",
"channel": "email"
},
{
"name": "App Feature Highlight",
"channel": "in_app"
},
{
[
{
"name": "Welcome Series",
"description": "A sequence of emails introducing new subscribers to your brand and products."
},
{
"name": "Abandoned Cart Reminder",
"description": "Push notifications reminding users to complete their purchase after leaving items in their cart."
},
{
This file has been truncated, but you can view the full file.
[{"photo_id": "bygTaBey1Xk", "photo_url": "https://unsplash.com/photos/bygTaBey1Xk", "photo_image_url": "https://images.unsplash.com/uploads/1413387620228d142bee4/23eceb86", "photo_submitted_at": "2014-10-15 15:40:40.111061", "photo_featured": "t", "photo_width": "4635", "photo_height": "3070", "photo_aspect_ratio": "1.51", "photo_description": "", "photographer_username": "jaspervandermeij", "photographer_first_name": "Jasper", "photographer_last_name": "van der Meij", "exif_camera_make": "PENTAX RICOH IMAGING", "exif_camera_model": "GR", "exif_iso": "100", "exif_aperture_value": "14.0", "exif_focal_length": "18.3", "exif_exposure_time": "8", "photo_location_name": "", "photo_location_latitude": "", "photo_location_longitude": "", "photo_location_country": "", "photo_location_city": "", "stats_views": "1708356", "stats_downloads": "19085", "ai_description": "sea and rock cliff with grasses under cloudy sky", "ai_primary_landmark_name": "Neist Point", "ai_primary_landmark_latitude": "57.428386927437906", "ai_
This file has been truncated, but you can view the full file.
[
{
"photo_id": "bygTaBey1Xk",
"photo_url": "https://unsplash.com/photos/bygTaBey1Xk",
"photo_image_url": "https://images.unsplash.com/uploads/1413387620228d142bee4/23eceb86",
"photo_submitted_at": "2014-10-15 15:40:40.111061",
"photo_featured": "t",
"photo_width": "4635",
"photo_height": "3070",
"photo_aspect_ratio": "1.51",
This file has been truncated, but you can view the full file.
[
{
"photo_id": "bygTaBey1Xk",
"photo_url": "https://unsplash.com/photos/bygTaBey1Xk",
"photo_image_url": "https://images.unsplash.com/uploads/1413387620228d142bee4/23eceb86",
"photo_submitted_at": "2014-10-15 15:40:40.111061",
"photo_featured": "t",
"photo_width": "4635",
"photo_height": "3070",
"photo_aspect_ratio": "1.51",
@karngyan
karngyan / prompt_linear_issue.p10k.zsh
Created May 10, 2024 07:24
Adds linear issue title to your prompt in p10k theme + omz (tested only on mac)
function prompt_linear_issue() {
if git rev-parse --git-dir > /dev/null 2>&1; then
local git_root=$(git rev-parse --show-toplevel)
local id=$(git rev-parse --abbrev-ref HEAD)
local cache_file="$git_root/.git/issue_title_cache_$id" # cache file unique to each branch
# fetch current time & file mod time
local current_time=$(date +%s)
local file_mod_time=$(date -r "$cache_file" +%s 2>/dev/null || echo 0)
@karngyan
karngyan / main.go
Created August 8, 2021 02:10
Mutex/RWMutex
package main
import (
"fmt"
"math"
"os"
"sync"
"text/tabwriter"
"time"
)
@karngyan
karngyan / aws.nuxt.s3.gulpfile.js
Created May 20, 2021 19:58
Gulpfile to automate nuxt generate deployments to S3 backed by Cloudfront CDN, Caches _nuxt for an year.
const gulp = require('gulp')
const awspublish = require('gulp-awspublish')
const awspublishRouter = require("gulp-awspublish-router");
const cloudfront = require('gulp-cloudfront-invalidate-aws-publish')
const parallelize = require('concurrent-transform')
// https://docs.aws.amazon.com/cli/latest/userguide/cli-environment.html
const config = {
// Required