Skip to content

Instantly share code, notes, and snippets.

View hassansin's full-sized avatar
👋
Working from home

Hassansin hassansin

👋
Working from home
View GitHub Profile
@hassansin
hassansin / send-to-kindle.js
Created September 22, 2017 09:52
Webtask to send any Webpage to Kindle as PDF
'use latest';
import nodemailer from 'nodemailer@2.5.0';
import request from 'request@2.81.0';
module.exports = function(context, cb) {
const url = context.query.url;
const kindleAddress = context.query.address || context.secrets.KINDLE_ADDRESS;
if (!url) {
return cb(null, "missing url parameter");
@hassansin
hassansin / request-response.go
Last active April 13, 2023 10:44
Request-response pattern over asynchronous protocol using Go channel
package main
import (
"errors"
"fmt"
"math/rand"
"net/http"
"sync"
"time"
@hassansin
hassansin / prepare-commit-msg.sh
Last active March 2, 2023 01:06
Clubhouse - Git Hooks
#!/bin/sh
# If commit message does not refer to any CH story number,
# this hook will parse the CH story from the current branch and
# append it to the commit message
#
# Example:
# Branch: hassansin/ch1643/custom-subdomains
# commit message: add support for EU base urls
# appended commit message: Add support for EU base urls [ch1643]