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 / quick-actions-finder-macos-big-sur.md
Last active February 25, 2025 23:20 — forked from tonysneed/Mac OS X: Open in Visual Studio Code
Add Quick Actions to Finde in macOS Big Sur to open a folder in VS Code
  • Open Automator
  • Choose Quick Action as the document type
  • Change Workflow receives current to files or folders in Finder.app
  • For Action, choose Open Finder items from the left hand sidebar
  • Change Open with to Visual Studio Code.app (find it in Other... )
  • For the Icon, change Image to "Choose..." and select the Visual Stuido Code app. It'll automatically pick the icon
  • Save it (Cmd+S) as something like "Open in VS Code"
@aamnah
aamnah / import_databases.sh
Last active May 30, 2018 16:18
Import MySQL Databases from another server
#!/bin/bash
# Author: Aamnah
# Link: https://aamnah.com
# get and restore all databased from another server on this server
REMOTE_SSH_HOST='123.123.123.123' # Server IP or FQDN of the remote server you're importing from
REMOTE_SSH_USER='root'
REMOTE_SSH_KEY="~/.ssh/id_rsa"
@aamnah
aamnah / import_sites.sh
Last active April 19, 2018 14:48
Import Apache websites along with their conf files and Let's Encrypt SSL certs from another server
#!/bin/bash
# Purpose: Transfer /var/www files from another server
# This PULLS the changes, i.e. it'll fetch stuff from another server
# and write on the one you're running the command from
# Pull: sync remote with local
# Include a config.sh file that has variables
# scriptPath="${BASH_SOURCE%/*}"
# source "${scriptPath}/config.sh"
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
/* url("webfont.otf") format("opentype") */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
@aamnah
aamnah / uninstall_amp.sh
Last active April 5, 2018 13:03
Uninstall and Re-install AMP with Homebrew
# UNINSTALL
# See what versions are installed with `brew list | grep php`
brew remove --force --ignore-dependencies httpd
brew remove --force --ignore-dependencies php70-xdebug php71-xdebug
brew remove --force --ignore-dependencies php70-imagick php71-imagick
brew remove --force --ignore-dependencies mcrypt php70-mcrypt
brew remove --ignore-dependencies --force php70 php71 php72
# RE-INSTALL
@aamnah
aamnah / products_inQuantity_zeroWeight.sql
Created December 23, 2017 15:39
OC Products with no weight
-- Get all products that have:
-- weight <= 0
-- quantity >= 1
SELECT
oc_product.product_id,
REPLACE(oc_product_description.name, '&quot;', '"') AS 'Title',
oc_product.model AS 'Model',
oc_product.weight AS 'Weight',
@aamnah
aamnah / products.sql
Last active November 18, 2023 14:17
OpenCart to Shopify - export Products in Shopify CSV format
/*
Handle
Title = oc_product_description.name
Body (HTML) = oc_product_description.description
Vendor = oc_product.manufacturer_id
Type
Tags = oc_product_description.tag
Published = oc_product.status
Option1 Name
Option1 Value
@aamnah
aamnah / db.sql
Last active November 25, 2017 09:34
Database Getting Started
-- Create a Database
CREATE DATABASE IF NOT EXISTS mydatabase;
-- Switch to using that database
-- (so that all tables are created in this and not the master db)
USE mydatabase;
-- Create a Table
CREATE TABLE IF NOT EXISTS mytable
(
@aamnah
aamnah / customers.sql
Last active November 30, 2017 13:49
OpenCart to Shopify - export customers in Shopify CSV format
-- Run this command on the OpenCart database to get Customers in the required Shopify format
SELECT
oc_customer.firstname AS 'First Name',
oc_customer.lastname AS 'Last Name',
oc_customer.email AS 'Email',
oc_address.company AS 'Company',
oc_address.address_1 AS 'Address1',
oc_address.address_2 AS 'Address2',
oc_address.city AS 'City',
@aamnah
aamnah / .htaccess
Last active May 30, 2018 16:18
Gzip compress with `mod_deflate` in Apache
# Enable Gzip compression for your site
# This goes in the .htaccess file for your site
# Or the server wide httpd.conf if you want to enable it for all sites
# https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-mod_deflate-on-ubuntu-14-04
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript