Skip to content

Instantly share code, notes, and snippets.

View ultrasamad's full-sized avatar
🎯
Focusing

Samad Ibrahim ultrasamad

🎯
Focusing
View GitHub Profile

Windows terminal settings

This is my windows terminal settings file

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
@ultrasamad
ultrasamad / mysql-installation.md
Created May 5, 2020 13:33
Installation and setup of MySQL on windows

Getting started with mysql installation and configuration

Installation

  • Download and install the latest version of Visual C++ redistributable if it's not already installed
  • Download and extract mysql archive file and extract to somewhere on your filesytem
  • Add a path to the bin directory of your mysql installation to your environment path
  • Create a my.ini file in the bin directory with the following contents
    [mysqld]
    

//Set basedir to your installation path

@ultrasamad
ultrasamad / postgres-howto.md
Last active September 22, 2020 11:11
Common How Todos with PostGreSQL

Common How Todos with PostGreSQL

A list of common tasks or commands used frequently in PostGreSQL


Change port number

  1. Locate the port entry in postgresql.conf file. In windows the path is C:\Program Files\PostgreSQL\{VERSION}\data and change the value to your new port.
  2. Restart PostGres service. In windows search and open the application services.msc and restart Postgres from there.
  3. Change the port for pgAdmin. If you have pgAdmin installed, you need to change the port for that server.
  4. First Right click on the specific server and click disconnect.
@ultrasamad
ultrasamad / postgres-postgis-cheatsheet.md
Last active April 28, 2020 08:18
Get started with PostGIS in PostGreSQL

Get started with PostGis in PostGreSQL

Note: Coordinates are in (longitude latitude) format

Enable PostGIS extension for the current database

CREATE EXTENSION postgis;

Upgrade PostGIS version

@ultrasamad
ultrasamad / Cart.js
Created August 14, 2017 12:41
A simple shopping cart implementation in javascript based on es6.
class Cart{
constructor(products) {
if (!this.storageSupported()){
throw "Browser doesn't support localStorage"
}
this.products = products;
//this.items = JSON.parse(localStorage.getItem('cart'))
}
@ultrasamad
ultrasamad / ArrayFlatter.php
Created July 7, 2017 14:41
This scripts collects all arguments of the function consisting of primitives and arrays and then flattens into a one dimensional array.
<?php
/**
*@author Ibrahim Samad
*@date 6/6/2017
*@description A simple class that flatten a multi-dimensional array into a single array
*while taking care of null values.
*/
class ArrayFlatter
{