Skip to content

Instantly share code, notes, and snippets.

Ashhar Hasan hashhar

Block or report user

Report or block hashhar

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
@hashhar
hashhar / README.md
Last active May 16, 2019
Tombstone effects on KStream, KTable and reduce
View README.md

Input

$ kafkacat -P -b 0.0.0.0:9092 -t input -K : -Z
1:INSERT
1:UPDATE
1:
1:INSERT_NEW
@hashhar
hashhar / pwned-interactive.rb
Created Mar 12, 2019 — forked from schmich/pwned-interactive.rb
Check if a password has been pwned with the Pwned Passwords V2 API
View pwned-interactive.rb
# Check a single password interactively.
# Usage: ruby pwned-interactive.rb
require 'io/console'
require 'open-uri'
require 'digest'
puts "The 5-character prefix of the password's SHA-1 hash will be sent."
puts "For details, see https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/"
print 'Password (hidden): '
@hashhar
hashhar / .inputrc
Created Oct 4, 2018
Inputrc for better readline
View .inputrc
# Make Tab autocomplete regardless of filename case
set completion-ignore-case on
# List all matches in case multiple possible completions are possible
set show-all-if-ambiguous on
# Use the text that has already been typed as the prefix for searching through
# commands (i.e. more intelligent Up/Down behavior)
"\e[B": history-search-forward
"\e[A": history-search-backward
View tab-center-redux.css
/* Hide the New Tab button */
#newtab {
display: none;
}
/* Remove extra padding and margins from Search tabs field */
#searchbox {
padding: 0px;
margin: -2px;
}
@hashhar
hashhar / example.php
Created Aug 25, 2017
Test case for RainbowParentheses.vim
View example.php
<?php
/**
* Copyright 2011 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@hashhar
hashhar / bar.sh
Last active Aug 30, 2017
MPD Status in i3status
View bar.sh
#!/bin/bash
i3status | while :
do
read line
printf -v mpd_song "%q" "$(mpc current -f "[[%albumartist%|%artist% - ]%title%]")"
# printf -v sets the variable to '' in case of empty assignment
if [[ "$mpd_song" == "''" ]]; then
printf -v mpd_song "%q" "$(basename "$(mpc current -f "%file%")")"
@hashhar
hashhar / _aurvote
Last active Jul 4, 2017
Bash Completion Scripts
View _aurvote
# Written: Ashhar Hasan (hashhar_dev at outlook dot com) on 13 April 2017
_cache_file="${XDG_CACHE_HOME:=~/.cache}/aurvote/packages.gz"
# If cache file is older than a week or doesn't exist yet, update it.
_setup_cache()
{
local last_update=1
[ -e "${_cache_file}" ] && last_update=$(stat -c %Y "${_cache_file}")
# Compare the epoch times of existing file and current date.
@hashhar
hashhar / firefly.1611290733
Created Apr 12, 2017
Firefly (TV series) fortune cookie file
View firefly.1611290733
See also:Serenity (film)
"The Ballad of Serenity" (Theme song) written by Joss Whedon
Mal: We have done the impossible, and that makes us mighty.
-- Firefly (TV series) - None
%
Bendis: We're gonna die.
Mal: We're not gonna die. We can't die, Bendis. You know why? Because we are so... very... pretty. We are just too pretty for God to let us die. Huh? Look at that chiseled jaw!
@hashhar
hashhar / 10-powerline-symbols.conf
Created Apr 1, 2017
Fontconfig powerline fallback
View 10-powerline-symbols.conf
# This file goes in $HOME/.config/fontconfig/conf.d/
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>monospace</family>
<prefer><family>PowerlineSymbols</family></prefer>
</alias>
<alias>
@hashhar
hashhar / README-Template.md
Created Mar 12, 2017 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

You can’t perform that action at this time.