Skip to content

Instantly share code, notes, and snippets.

Working from home

Hassansin hassansin

Working from home
Block or report user

Report or block hassansin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hassansin /
Last active Jul 3, 2018
Clubhouse - Git Hooks
# 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]
hassansin / request-response.go
Last active Mar 21, 2019
Request-response pattern over asynchronous protocol using Go channel
View request-response.go
package main
import (
hassansin / send-to-kindle.js
Created Sep 22, 2017
Webtask to send any Webpage to Kindle as PDF
View send-to-kindle.js
'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 /
Last active Feb 3, 2019
Remote Debugging with XDebug 2.1


A PHP extension that allows you to:

  1. walk through your code by Remote Debugging
  2. find bottlenecks in your application by Profiling
  3. find Code Coverage in a single request
  4. trace your application by logging all function calls
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src=""></script>
<script src=""></script>
hassansin / send.js
Created Sep 26, 2016
Send Joke with AWS SNS
View send.js
#!/usr/bin/env node
* Send a Joke to your mobile using AWS SNS service
* Usage:
* ./send.js phoneNumber [firstName] [lastName]
const http = require('http');
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
hassansin /
Last active Apr 11, 2016
Working with MongoDB TTL (Time-To-Live) Index
hassansin / commands.js
Last active Mar 22, 2016
MongoDB commands
View commands.js
db.collection.createIndex( { orderDate: 1, zipcode: -1 }, {background: true} ) { "timestampISO": 1 }, { expireAfterSeconds: 120*24*60*60 } ) // <3.0, TTL index, 120day retention period
db.collection.getIndexes() //get all indexes
db.collection.dropIndex("name"); //drop single index
db.collection.dropIndexes(); //drop all indexes
db.collection.find({ email: '' }).explain("executionStats") // <3.0 :
db.collection.explain("executionStats").find({ email: '' }) // 3.0 + // in bytes, should not exceed RAM
hassansin / .block
Last active Mar 9, 2016
D3 Chronograph Stopwatch
View .block
license: gpl-3.0
height: 300
border: no
You can’t perform that action at this time.