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 / .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'
@aamnah
aamnah / README.md
Last active October 17, 2024 16:18
Cheats and helpers for creating a custom oh-my-zsh theme and git prompt

Zsh custom git prompt cheatsheet

Everything you need for customizing your git prompt in oh-my-zsh

  • print and echo commands for all functions in the git plugin. Printing and echoing because then i can check what values are outputted. Massively helpful when creating a theme.
  • a list of all the variables that you can use to customize $(git_prompt_info), thanks to vergenzt
grep -o "ZSH_THEME_GIT_[A-Z_]\+" lib/git.zsh| sort | uniq
@aamnah
aamnah / README.md
Last active April 30, 2020 15:45
Change WordPress Multisite Domain

Change WordPress Multisite Domain

You need to update five different tables in the database in order to change the domain, as well as updating the wp-config.php file

The following SQL script takes care of updating all tables in one go. Make sure to replace newdomain.com and olddomain.com (minus the http:// at the begining and / at the end) with the domain you want to change to before running the SQL commands

In wp-config.php, update the following line:

define( 'DOMAIN_CURRENT_SITE', 'newdomain.com' );
@aamnah
aamnah / README.md
Created April 24, 2020 13:21
Script to install Letsencrypt certs non-interactively

Install SSL certificates non-interactively

Use this script as part of any installation script. I use it as part of my script for settting up a virtualhost for a domain/website on Apache

tl;dr

you need these additional flags

  • --non-interactive
  • --agree-tos
  • --register-unsafely-without-email or --email ${SSL_EMAIL}
@aamnah
aamnah / vscode-extensions.md
Created January 5, 2020 10:08
VS Code Extensions
  • C/C++
  • C#
  • Dart
  • Flutter
  • GitLens
  • Horizon Theme
  • Import Cost
  • Prettier - Code formatter
  • vscode-icons
  • Code Sell Checker
@aamnah
aamnah / Placeholder.tsx
Last active November 22, 2019 07:27
Placeholder SVG component to indicate loading and wireframe application
/*
USAGE:
<Placeholder />
<Placeholder loading={false}/>
<Placeholder shape='circle' size={150}/>
<Placeholder shape='rect' width={200} height={100}/>
<Placeholder loading={false} shape='circle' size={100}/>
*/
@aamnah
aamnah / media-queries.scss
Created July 11, 2019 06:24
100% Correct Media Queries
// https://www.freecodecamp.org/news/the-100-correct-way-to-do-css-breakpoints-88d6a5ba1862/
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
@aamnah
aamnah / install_percona.sh
Last active March 27, 2019 14:00
install Percona repo and xtrabackup on old Ubuntu
# https://www.percona.com/doc/percona-xtrabackup/2.3/installation/apt_repo.html
#!/bin/bash
# Percna XtraBackup (Debian 7.0 Wheezy / Ubuntu 14.04LTS trusty onwards)
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
sudo apt-get update
sudo apt-get install -y percona-toolkit percona-xtrabackup-24
@aamnah
aamnah / fix_npm_perms.sh
Last active March 27, 2019 11:46
Fix npm permissions for running global packages
#!/bin/bash
# source:
# https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
fix_npm_permissions () {
# create a new directory for installing npm pacages
mkdir ${HOME}/.npm-global
# Configure npm to use the new directory path: