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 / 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:
@aamnah
aamnah / sysctl.conf
Last active March 27, 2019 11:13
Increase file watchers (error ENOSPC)
# sudo nano /etc/sysctl.conf
###################################################################
# Increase the number for files being watched
# Default is: 8192 (files that can be watched)
# One file watch roughly takes 1kb.
# 1048576 files being watched would take a max of 1GB of memory
#
# Gets rid of (error ENOSPC) given by Node and VS Code
# https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
@aamnah
aamnah / .xprofile
Last active November 25, 2019 09:40
Monitor profile for multi-monitor setups
# ~/.xprofile
# Get attached screens and resolution details with `xrandr`
# Get resolution modelines with `gtf` or `cvt`
# e.g: `gtf 2560 1440 60 -x` or `cvt 2560 1440 60`
# You can use `--right-of` and `--left-of` to arrange monitors
# e.g: `--right-of DP-1`
#-------------------------------------------#
@aamnah
aamnah / example.com.conf
Created February 28, 2019 06:49
Virtual Host conf for SSL enabled site
# domain: example.com
# public: /var/www/example.com/public_html/
# logs: /var/www/example.com/logs/
<VirtualHost *:443>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@example.com
ServerName example.com
#ServerAlias example.com
@aamnah
aamnah / dump.jsx
Created February 22, 2019 06:52
Dump state inside React Components
<pre>
<code>{JSON.stringify(this.state.blah, null, 2)}</code>
</pre>