Skip to content

Instantly share code, notes, and snippets.

Avatar

Ashhar Hasan hashhar

View GitHub Profile
@hashhar
hashhar / Firefox Nightly Setup.md
Last active Oct 6, 2020
Firefox Nightly Setup
View Firefox Nightly Setup.md

Firefox Nightly Setup on Linux

Download latest Firefox Nightly build from here.

Once downloaded, extract to some location.

cd Downloads
sudo chown -R $USER:$USER /opt
tar -xvf firefox-xxx.tar.bz2 -C /opt
@hashhar
hashhar / Trino Query Examples.md
Last active May 23, 2021
Sample Python3 example to run SQL queries concurrently
View Trino Query Examples.md

Trino Query Examples

Python

  • Install trino client as pip install trino.
  • Set the env vars TRINO_HOST, TRINO_PORT, TRINO_USER, TRINO_CATALOG and TRINO_SCHEMA.
  • Run as python3 <file.py>.
View coordinator.yaml
kind: Deployment
apiVersion: apps/v1
metadata:
name: coordinator
labels:
presto: coordinator
spec:
replicas: 1
template:
metadata:
@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 / .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!