Skip to content

Instantly share code, notes, and snippets.

View MousaHalaseh's full-sized avatar
🚀

Mousa Halaseh MousaHalaseh

🚀
  • Amman, Jordan
View GitHub Profile
@MousaHalaseh
MousaHalaseh / up.sh
Created November 21, 2023 12:36
up function
function up(){
if [[ $1 != "" ]] && [[ $1 -lt 1 ]] ; then echo "Argument must be a positive integer."; fi
for n in $(seq 1 $1); do dots+="../"; done
cd $dots
n=""
dots=""
}
#!/bin/bash
# Shell prompt based on the Solarized Dark theme.
# Screenshot: http://i.imgur.com/EkEtphC.png
# Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
# iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
# vim: set filetype=sh :
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM='gnome-256color';
elif infocmp rxvt-unicode-256color >/dev/null 2>&1; then
@MousaHalaseh
MousaHalaseh / DayOfWeekCalculator.kt
Created August 22, 2023 15:26
Find the day of week for any date given after 1751 in Kotlin
package sample
import java.time.DayOfWeek.*
import java.time.LocalDate
class DayOfWeekCalculator
fun main() {
val date = LocalDate.now()
println("The day of week is ${calculateDayOfWeek(date)} for $date")
@MousaHalaseh
MousaHalaseh / cat.sh
Created March 2, 2020 14:08
highlighter cat
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo "Please provide file path";
exit 1;
fi
touch CAT_TO_PYGMENTIZE_TEMP;
/usr/bin/cat $1 >> CAT_TO_PYGMENTIZE_TEMP 2> /dev/null;
# Final plan to do this,
"""
# Define a 10*8 matrix (call it the game_play)
# Give each character a digit, say the following: // In order to perform some mathematical operations.
m = 5, w = 4, s = 3, b = 2, g = 1
#
# Start from a specific point in the grid, find all of it's associated paths.
# check that it's neither in the open_list nor the closed_set, if it does `continue` to next path.
# If a path is valid add it to the open_list,otherwise through it in the closed_set.
// A path is valid if it contains no single mine //