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 / install-opencart.sh
Last active April 6, 2020 15:06
Opencart Install Script
#!/bin/bash
# Author: Aamnah Akram
# URL: http://aamnah.com
# Email: hello@aamnah.com
# Description: Bash script to install Opencart
# Usage: You can use 'curl' to run this script directly from Github.
# curl -L https://gist.githubusercontent.com/aamnah/93cb63fc15e708649084/raw | bash
# COLORS
Cyan='\033[0;36m' # Cyan
@aamnah
aamnah / jekyll-new-post-advanced
Last active January 19, 2023 13:00
Bash script to create new Jekyll posts
#!/bin/bash
# About: Bash script to create new Jekyll posts
# Author: @AamnahAkram
# URL: https://gist.github.com/aamnah/f89fca7906f66f6f6a12
# Description: This is a more advanced version of the script which can
# - take options
# - has color coded status messages
# - improved code
# - lowercase permalinks
# - usage message
@aamnah
aamnah / opencart_store_details.sql
Created February 26, 2015 07:20
MySQL command to Update Store Details for all existing Orders in an Opencart store
# Update store_id, store_name and store_url for all existing orders
#####################################################################
# store_id can be checked with `SELECT * FROM oc_store`. Default store = 0
UPDATE oc_order SET store_id=0, store_name="Store Name", store_url="http://domain.com";
@aamnah
aamnah / domain.com.conf
Last active May 30, 2018 16:20
Vhost sample file for Apache2
# domain: domain.com
# public: /var/www/domain.com/public_html/
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin hello@aamnah.com
ServerName www.domain.com
ServerAlias domain.com
@aamnah
aamnah / gravatar.php
Last active August 29, 2015 14:18
Gravatar
<?php
$email = "aamnah@aamnah.com";
$email_neat = strtolower(trim($email));
$email_hash = md5($email_neat);
$file_type = 'jpg';
$size = 80;
$gravatar = 'http://www.gravatar.com/avatar/'. $email_hash . '.' . $file_type. '?s=' . $size .'';
$gravatar_image = '<img src="'. $gravatar . '" />';
@aamnah
aamnah / opencart-ubuntu.sh
Last active April 13, 2020 17:21
Opencart settings for an Ubuntu server
#!/bin/bash
###
# Author: AAmnah
# Link: http://aamnah.com
# Description: Install script for Opencart 2.x on a Linux (Ubuntu/Debian) server
###
# Color Reset
Color_Off='\033[0m' # Text Reset
@aamnah
aamnah / clean_urls.php
Created April 4, 2015 05:34
Perfect Clean URL Generator
<?php
// Perfect Clean URL Generator
// Source: http://cubiq.org/the-perfect-php-clean-url-generator
setlocale(LC_ALL, 'en_US.UTF8');
function toAscii($str, $replace=array(), $delimiter='-') {
if( !empty($replace) ) {
$str = str_replace((array)$replace, ' ', $str);
}
@aamnah
aamnah / google_api_qrcode.php
Created April 4, 2015 10:05
Generate a QR code using Google Charts API
<?php
// Source: http://stackoverflow.com/questions/5943368/dynamically-generating-a-qr-code-with-php
// Google Charts Documentation: https://developers.google.com/chart/infographics/docs/qr_codes?csw=1#overview
// CHart Type
$cht = "qr";
// CHart Size
$chs = "300x300";
@aamnah
aamnah / colors.scss
Created April 4, 2015 12:04
Sass Variables - Flat Colors
// FLAT COLORS
// Source: http://www.flatuicolorpicker.com
$ChestnutRose: #D24D57;
$Pomegranate: #F22613;
$Thunderbird: #D91E18;
$OldBrick: #96281B;
$Flamingo: #EF4836;
$Valencia: #D64541;
$TallPoppy: #C0392B;
@aamnah
aamnah / vhost.sh
Last active July 1, 2019 06:58
Bash script to create virtual host file
#!/bin/sh
############
# Author: Aamnah
# URL: http://aamnah.com
# Based on: https://www.linode.com/docs/websites/hosting-a-website
############
# Reset
Color_Off='\033[0m' # Text Reset