Skip to content

Instantly share code, notes, and snippets.

@abzrg
abzrg / foampeek.sh
Last active June 14, 2024 00:54
Take a Peek at an OpenFOAM Library/Applications
#!/bin/sh -e
# Take a Peek at an OpenFOAM Library/Application
#
# Usage: `foampeek [-l|--lucky] [-p|--project lib/app] [-f|--file file] [lib/app] [file]`
#
# Firstly, it prompts you to select a library (in `$FOAM_SRC`) or an application
# (in `$FOAM_APP`), and finally, it lists all the files in that lib/app for you
# to select.
#
@abzrg
abzrg / Makefile
Last active April 22, 2024 17:21
A Makefile for Latex projects
#------------------------------------------------------------------------------
# Author:
# Ali Bozorgzadeh
# Copyright:
# Copyright (c) 2024 Ali Bozorgzadeh
# License:
# The MIT License (see https://opensource.org/license/mit)
#------------------------------------------------------------------------------
# Project structure:
#
@abzrg
abzrg / darkplus.css
Last active November 5, 2022 15:22
darkplus theme for overleaf (first choose the tommorow night and then apply this theme)
/* ==UserStyle==
@name overleaf.com - 11/5/2022, 4:42:33 PM
@namespace github.com/openstyles/stylus
@version 1.0.0
@description A new userstyle
@author Me
==/UserStyle== */
@-moz-document domain("overleaf.com") {
/* Insert code here... */
@abzrg
abzrg / swak4Foam.patch
Last active October 10, 2022 03:44
swak4Foam patch for OpenFOAM-v2206 (for M1 Mac)
diff -r 481d96f16780 Allwclean
--- a/Allwclean Mon Jul 04 01:06:48 2022 +0200
+++ b/Allwclean Fri Sep 23 20:40:05 2022 +0330
@@ -13,7 +13,7 @@
find . -name "*.dep" -print -exec rm {} \;
-find . -name compile_commands.json -print0 | xargs --null rm -f
-find . -name .clangd -print0 | xargs --null rm -rf
+find . -name compile_commands.json -print0 | xargs -0 rm -f
@abzrg
abzrg / timer.py
Last active September 3, 2022 17:55
A simple timer for me that counts from zero upward!
#!/usr/bin/env python3
"""\
. . .
timer
. . .
A timer that counts from time 0 to the final time
USAGE: timer <secs>
@abzrg
abzrg / OpenFOAM-3.Dockerfile
Last active July 24, 2022 10:17
Install OpenFOAM-3 using Docker
# OpenFOAM-3 can be installed on ubuntu 14.04 LTS
FROM ubuntu:trusty
# Install dependency and some softwares
# NOTE that you should not install build-essential as it clashes with
# the version of the compiler that openfoam is build with
RUN : \
&& apt-get update \
&& apt-get install -y \
@abzrg
abzrg / .clang-format
Last active May 29, 2022 13:50 — forked from idelsink/.clang-format
Clang format file.
# clang-format
# Made by: Ingmar Delsink
# idelsink.com
# See http://clang.llvm.org/docs/ClangFormatStyleOptions.html
# Tested with: clang-format version 3.7.1
# General
#########
# The style used for all options not specifically set in the configuration.
@abzrg
abzrg / pronunciation.sh
Last active July 17, 2022 20:56
pronunciation.sh
#!/bin/sh -e
# This script grabs the pronunciation (either uk or us) from
# <https://dictionary.cambridge.com>.
#
# Author: Ali Bozorgzadeh <https://github.com/reverseila>
#
# USAGE: p word [accent]
# accents: uk (default), us
# example: p aesthetic us
@abzrg
abzrg / android.package.name.sh
Last active November 11, 2021 21:55
De-bloat android knowing the name of the applications
# source: https://forum.xda-developers.com/t/guide-debloat-remove-stock-apps-without-root.3829593/
adb shell pm uninstall -k --user 0 com.google.android.apps.docs # Google Hangout
adb shell pm uninstall -k --user 0 com.google.android.apps.docs # Google Drive
adb shell pm uninstall -k --user 0 com.google.android.apps.maps # Google Maps
adb shell pm uninstall -k --user 0 com.google.android.apps.photos # Google Photos
adb shell pm uninstall -k --user 0 com.google.android.apps.tachyon # Google Duo
adb shell pm uninstall -k --user 0 com.google.android.googlequicksearchbox # Google App
adb shell pm uninstall -k --user 0 com.google.android.music # Google Music
adb shell pm uninstall -k --user 0 com.google.android.videos # Play Movies