Skip to content

Instantly share code, notes, and snippets.

View hasantahir's full-sized avatar

Hasan Tahir Abbas hasantahir

  • University of Glasgow
  • Glasgow, UK
  • 05:13 (UTC -12:00)
View GitHub Profile
@hasantahir
hasantahir / Mindmap.md
Last active September 13, 2022 11:55
P4 - Mindmap

Abstract - Programming protocol-independent packet processors

Keywords

  • Software Defined networking
  • network function virtualisation
  • 5G networks
  • data plane programmability
  • Lower latency
  • Edge computing
  • Backhaul network
@hasantahir
hasantahir / gist:e120d14d49928501d3c2dd6081f36c92
Created November 23, 2020 13:37
Remap the Application key using the Karabiner Elements
For a windows keyboard hooked up to a Mac, the application key by default is useless. To make it work as a Fn key, we need to use Karabiner elements. We need to modify the key from 'Application' to 'Fn'. If it is not visible in the Karabiner-Elements, use the Karabiner-EventsViewer to get the keyboard mappings and codes.
@hasantahir
hasantahir / gist:eb9cb4ff2a0714f93cd35b7107be72c6
Created September 23, 2020 20:42
If there are a lot of subfolders and they need to be removed. Use the following terminal command
sudo find Exported\ Items -name "*.pdf" -type file -exec cp {} Exported\ Items/ \;
In the above example: all the PDFs that could be within any level of the main folder 'Exported Items' are copied to the root folder.
This is particularly useful when zotero is used to export PDFs.
@hasantahir
hasantahir / gist:ef0c77e203bae8321c4936d2e3634008
Last active July 22, 2020 13:01
Useful Commands for MACOS
// Create a list of installed apps on Macos
// Note that this also creates a list of all the packages installed via Homebrew and pip
ls -l /Applications | open -ef && ls -l /usr/local/bin | open -ef
// The resulting text file can then be saved.
@hasantahir
hasantahir / gist:716bdb311a4b18e63da94e2cc62e2e4e
Last active June 17, 2020 09:15
ImageMagick / Inkspace commands for compressing and converting between different file formats
%% To convert an animated PDF generated out of LaTeX into a GIF:
convert -verbose -delay 50 -loop 0 -density 300 file.pdf file.gif
%% Inkspace SVG to PDF:
```Tip to avoid multipage pdf generation headache:
Ensure text is always top of eerything
select text and then Object -> Raise to top
All text objects can be selected from the find command enabling the 'select by type -> text' option.
@hasantahir
hasantahir / init.lua
Last active June 8, 2020 16:20
My Config File of Hammerspoon
-- -----------------------------------------------------------------------
-- ** HammerSpoon Config File by S1ngS1ng with ❤️ ** --
-- -----------------------------------------------------------------------
-- *** Please refer to README.MD for instructions. Cheers! *** --
-- -----------------------------------------------------------------------
-- ** Something Global ** --
-- -----------------------------------------------------------------------
-- Uncomment this following line if you don't wish to see animations
@hasantahir
hasantahir / gist:748da201881c66b0edd13d0890ef2196
Created November 11, 2018 11:42
Inkspace command to export pdf with proper font structure
inkscape --file=e_diag.svg --export-area-drawing --without-gui --export-latex --export-pdf=e_diag.pdf
Tip to avoid multipage pdf generation headache:
Ensure text is always top of eerything
select text and then Object -> Raise to top
All text objects can be selected from the find command enabling the 'select by type -> text' option.
Open the pdf_tex file after compiling, and delete the lines that says \includegraphics for pages other than 1
@hasantahir
hasantahir / gist:4d8c0ce2b415803c2ce96c9c8b94fc98
Created June 24, 2018 07:42
How to balance the last page columns in an IEEE document
Use flushend package in the preamble:
\usepackage[keeplastbox]{flushend}
Just at the end of the document before invoking bibliographies, call:
\atColsEnd{\vfil}
@hasantahir
hasantahir / latex-clean.sh
Created June 22, 2017 15:44 — forked from djsutherland/latex-clean.sh
A bash script to clean latex temp files
#!/bin/bash
exts=".aux .lof .log .lot .fls .out .toc .dvi .bbl .bcf .blg -blx.aux -blx.bib -blx.bib .run.xml .fdb_latexmk .synctex.gz .syntex.gz(busy) .pdfsync .algorithms .alg .loa .thm .nav .snm .vrb .acn .acr .glg .glo .gls .brf .lol .idx .ilg .ind .ist .maf .mtc .mtc0 .pyg .nlo .tdo .xdy .keys"
for x in "${@:-.}"; do
arg=$(echo ${x:-.} | perl -pe 's/\.(tex|pdf)$//')
if [[ -d "$arg" ]]; then
for ext in $exts; do
rm -f "$arg"/*$ext
@hasantahir
hasantahir / gist:a9065a12e873b6d80a33656ec3dd1425
Created June 22, 2017 00:18
Will Robertson's: LaTeX-templates: [ LaTeX Preamble - Font Choices ]
%% LaTeX Preamble - Font choices
%% Each block selects new math, roman (serif), sans serif, and typewriter fonts.
%% Delete or comment out all but one to make your choice.
% Fourier for math | Utopia (scaled) for rm | Helvetica for ss | Latin Modern for tt
\usepackage{fourier} % math & rm
\usepackage[scaled=0.875]{helvet} % ss
\renewcommand{\ttdefault}{lmtt} %tt
% Latin Modern (similar to CM with more characters)