Skip to content

Instantly share code, notes, and snippets.

View acedesigns's full-sized avatar

Anele 'ace' M acedesigns

View GitHub Profile
@acedesigns
acedesigns / ubuntu.md
Created January 16, 2024 09:32 — forked from cednore/ubuntu.md
My personal environment setup guide on Ubuntu
@acedesigns
acedesigns / Dockerfile
Created January 15, 2024 17:47
Create a Dockefile Image and Start It
# syntax=docker/dockerfile:1
FROM ubuntu:20.04
LABEL org.opencontainers.image.authors="Anele 'ace' M <[email protected]>"
LABEL version="1.0"
LABEL "com.acemedia.vendor"="Ace Media Incorporated"
LABEL description="ace Media Docker Image to build PHP, NODE APPS"
# replace shell with bash so we can source files
@acedesigns
acedesigns / reversePolish.js
Last active November 6, 2020 12:05
Reverse Polish notation - A javascript Solution
function reversePolish(newExpr) {
let expr = newExpr.split(" ");
let stack =[];
if(expr === ''){
return 0;
}
for(let i=0; i<expr.length; i++) {
if(!isNaN(expr[i]) && isFinite(expr[i])) {
stack.push(expr[i]);
@acedesigns
acedesigns / app.sh
Created October 8, 2020 13:32
Generate Angular Apps with older @angular/cli versions
#Angular 2:the last RC version before switching to angular 4 as far as I can tell — based on this and the next version now depends on angular
npx -p @angular/[email protected] ng new angular2app
#Angular 4: the last CLI version before angular 5
npx -p @angular/[email protected] ng new angular4app
#Angular 5: the last CLI version before 6
npx -p @angular/[email protected] ng new angular5app
#Angular 6: the last CLI version before 7
loadCartItems() {
this.cartService.getCartItems()
.then(val => {
this.cartItems = val;
if (this.cartItems.length > 0) {
this.cartItems.forEach((value, index) => {
console.log(value);
this.totalAmount += parseInt(value.amount);
console.log(this.totalAmount);
});
@acedesigns
acedesigns / DatabaseSeeder.php
Created March 9, 2019 12:46 — forked from bgallagh3r/DatabaseSeeder.php
Disable Foreign Key Constraints when Seeding DB with Artisan Migrate/DB Seed This prevents SQL from throwing errors when you try to do DB::table()->truncate() as TRUNCATE is disallowed when FK constraints are in place.
class DatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Eloquent::unguard();
@acedesigns
acedesigns / meta-tags.md
Created November 9, 2018 11:32 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@acedesigns
acedesigns / meta-tags.md
Created November 9, 2018 11:32 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@acedesigns
acedesigns / apache_ssl_install.sh
Created August 27, 2018 13:53 — forked from AJNOURI/apache_ssl_install.sh
Install Apache2 and create self-signed ssl certificate on Ubuntu 14.04
#!/bin/bash
commonname=apachehttps.lab
country=FR
state=IDF
locality=Panam
organization=cciethebeginning.wordpress.com
organizationalunit=IT
[email protected]
#!/bin/sh
# Copyright (C) 2009-2017 Three Nine Consulting
# Always good practice to update packages. However ask user if they would like to do so
# For explanation on how this works and why check out https://garywoodfine.com/use-pbcopy-on-ubuntu/
read -p "Do you want to update your package repositories before proceeding ? " -n 1 -r
echo #adding new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
sudo apt update