Skip to content

Instantly share code, notes, and snippets.

View aamnah's full-sized avatar
💭
the learning never stops

Aamnah aamnah

💭
the learning never stops
View GitHub Profile
@aamnah
aamnah / wmo_weather_descriptions.json
Last active July 18, 2024 09:31 — forked from stellasphere/descriptions.json
WMO WW weather interpretation code descriptions (& images)
{
"0": {
"day": {
"description": "Sunny",
"image": "http://openweathermap.org/img/wn/[email protected]"
},
"night": {
"description": "Clear",
"image": "http://openweathermap.org/img/wn/[email protected]"
}
@aamnah
aamnah / build_embedded_dart_sass.sh
Created May 15, 2024 10:12
Install embedded dart sass on Netlify
#!/bin/bash
# This script was originally written so i could deploy Hugo sites to Netlify that were using Embedded Dart Sass to compile.
# This script is no no longer needed for the purpose above.
# NOTES
# - no point in adding line breaks in echo, Netlify logs disregard them
# refs
# - https://discourse.gohugo.io/t/using-dart-sass-hugo-and-netlify/37099/13
@aamnah
aamnah / check_os_ostype.sh
Last active March 31, 2022 09:23
Check operating system inside a bash script and change commands
# Flush DNS cache
if [[ $OSTYPE == darwin* ]]; then
# works on macOS
alias flushdns='sudo dscacheutil -flushcache'
elif [[ $OSTYPE == linux* ]]; then
# works on Ubuntu 18.04+
alias flushdns='sudo systemd-resolve --flush-caches'
fi
@aamnah
aamnah / README.md
Last active February 8, 2021 04:51
Bash function to save all images from a URL in the current directory, takes a URL as param

wget all images

Bash function to save all images from a URL in the current directory, takes a URL as param.

Saved it as a bash function so that i don't have to worry about remembering the params for wget.

  • -nd no directories (save all files to the current directory; -P directory changes the target directory)
  • -r -l 2: recursive level 2
  • -A accepted extensions
  • -H span hosts (wget doesn't download files from different domains or subdomains by default)
@aamnah
aamnah / README.md
Last active February 3, 2021 10:25
React Native - Running on physical device

NOTE: Seems like you can only test on one physical device at a time

Add manufacturer codes to udev rules

  • 0e8d - MediaTek (Infinix Hot 9)
  • 17ef - Lenovo
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0e8d", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
@aamnah
aamnah / README.md
Last active February 8, 2021 04:53
Urdu Nastaleeq font in WordPress WPML and other websites

Non-English WordPress sites

The lang attribute should be added with whatever the language code is. For example lang="ur" for Urdu. This needs to be added to any element where you have Urdu text. You can then target all lang attributes on the page that have the ur value and set the font family for it.

*[lang="ur"] { 
	font-family: 'Noto Nastaleeq;
}

The caveat with this approach is that it'll only work if the lang attribute exists and has the value set to ur. If you forget setting this, your custom Urdu font will not show.

@aamnah
aamnah / starttmux.sh
Created August 9, 2020 16:27 — forked from todgru/starttmux.sh
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@aamnah
aamnah / random-color.ts
Created August 5, 2020 05:58
get a random color every time
const getColor = () => (Math.floor(Math.random() * 255))
const style = {
color: `rgb(${getColor()},${getColor()},${getColor()})`
}
return (
<div>
<h4 style={style}>{message}</h4>
</div>
)
@aamnah
aamnah / .eslintrc.yaml
Created August 1, 2020 16:05
ESLint for React Native (sans Typescript support)
# .eslintrc.yaml
# Configuration: https://eslint.org/docs/user-guide/configuring
# Using with Prettier: https://prettier.io/docs/en/integrating-with-linters.html#recommended-configuration
root: true
extends:
- '@react-native-community'
- plugin:import/errors
- plugin:import/warnings
@aamnah
aamnah / .eslintrc.yaml
Last active August 3, 2020 06:40
Standard bootstrap for React Native projects
# .eslintrc.yaml
# Configuration: https://eslint.org/docs/user-guide/configuring
# Using with Prettier: https://prettier.io/docs/en/integrating-with-linters.html#recommended-configuration
root: true
extends:
- '@react-native-community'
- 'plugin:import/errors'
- 'plugin:import/warnings'