Skip to content

Instantly share code, notes, and snippets.

@hsingh23
hsingh23 / desert.txt
Created March 13, 2017 15:29
Peanut Butter + Chocolate Recipe
all items are measured by weight
1 part Powdered Sugar
1 part finely ground Gram Cracker
2 parts Peanut Butter either chunky or smooth
1 part Heavy Cream
1 part Good Quality Chocolate
Mix the powdered sugar, gram cracker, and peanut butter together.  spread evenly onto a tray or pan.  
@hsingh23
hsingh23 / Summary of the Amazon S3 Service Disruption
Created March 2, 2017 20:49
Summary of the Amazon S3 Service Disruption in the Northern Virginia (US-EAST-1) Region
https://aws.amazon.com/message/41926/
Summary of the Amazon S3 Service Disruption in the Northern Virginia (US-EAST-1) Region
We’d like to give you some additional information about the service disruption that occurred in the Northern Virginia (US-EAST-1) Region on the morning of February 28th. The Amazon Simple Storage Service (S3) team was debugging an issue causing the S3 billing system to progress more slowly than expected. At 9:37AM PST, an authorized S3 team member using an established playbook executed a command which was intended to remove a small number of servers for one of the S3 subsystems that is used by the S3 billing process. Unfortunately, one of the inputs to the command was entered incorrectly and a larger set of servers was removed than intended. The servers that were inadvertently removed supported two other S3 subsystems. One of these subsystems, the index subsystem, manages the metadata and location information of all S3 objects in the region. This subsystem is necessary to serve all G
.mdl-ripple {
background: #000;
border-radius: 50%;
height: 50px;
left: 0;
opacity: 0;
pointer-events: none;
position: absolute;
@hsingh23
hsingh23 / index.js
Last active December 30, 2016 19:01
async await example sync example (node only)
var async = require('asyncawait/async');
var await = require('asyncawait/await');
console.log("starting")
var getSomethingAsync = function(i){
return new Promise((resolve, reject) => {
setTimeout(()=>resolve(`money = ${i}`), Math.random()*500)
})
}
var foo = async(function() {
@hsingh23
hsingh23 / apt-fast.conf
Created July 17, 2016 17:34
/etc/apt-fast.conf
###################################################################
# CONFIGURATION OPTIONS
###################################################################
# Every item has a default value besides MIRRORS (which is unset).
# Use aptitude or apt-get?
# Note that for outputting the package URI list, we always use apt-get
# ...since aptitude can't do this
# Optionally add the FULLPATH to apt-get or apt-rpm or aptitude
# e.g. /usr/bin/aptitude
@hsingh23
hsingh23 / .zshrc
Created July 17, 2016 16:59
Harsh's oh my zsh like zplug zshrc
# Check if zplug is installed
if [[ ! -d ~/.zplug ]]; then
git clone https://github.com/zplug/zplug ~/.zplug
source ~/.zplug/init.zsh && zplug update --self
fi
# Essential
source ~/.zplug/init.zsh
# Make sure to use double quotes to prevent shell expansion
Flows:
create group:
1. get timezone, default alert time
2. create chore group
get group:
sign up with email password:
1. create user
fb = {
group: {
groupGuid: {
name: "name",
timezone: someTimezone,
owners: {
accountGuid: true,
}
}
},
// ==UserScript==
// @name Stash PR links for commits
// @namespace https://gist.githubusercontent.com/hsingh23/67528e4193cf84cad3f1/raw/stash-pullrequest-linker.user.js
// @version 1.0.9
// @downloadURL https://gist.githubusercontent.com/hsingh23/67528e4193cf84cad3f1/raw/stash-pullrequest-linker.user.js
// @updateURL https://gist.githubusercontent.com/hsingh23/67528e4193cf84cad3f1/raw/stash-pullrequest-linker.user.js
// @description Stash's commit view does not show you which pull request a commit belongs to. This script links it up as best as it can.
// @author Harsh Singh
// @match https://*/projects/*/repos/*/commits*
// @match http://*/projects/*/repos/*/commits*
#!/bin/bash
# INFO=$(xwininfo -frame)
# WIN_GEO="--width="
# WIN_GEO="$WIN_GEO$(echo $INFO | grep -oEe 'geometry [0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+' | grep -oEe '[0-9]+x[0-9]+')"
# WIN_XY="--x="
# WIN_XY="$WIN_XY$(echo $INFO | grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | sed -e 's/+/ --y=/' )"
# WIN_HEI=`echo $WIN_GEO | sed s/x/\\ --height=/g`
XWININFO=$(xwininfo)
read X < <(awk -F: '/Absolute upper-left X/{print $2}' <<< "$XWININFO")