Skip to content

Instantly share code, notes, and snippets.

View ans1genie's full-sized avatar
🍅
Focusing

Anas AIT BAHA ans1genie

🍅
Focusing
View GitHub Profile
@ans1genie
ans1genie / git-notes.md
Created August 10, 2021 08:25
some git useful commands

TLDR:

It helps you to find out the commit ID of the current HEAD

git rev-parse HEAD

OR if you want the shorter commit

@ans1genie
ans1genie / download-website-offline.md
Last active April 20, 2021 22:50
download website offline
@ans1genie
ans1genie / git-understanding-qs.md
Created February 16, 2021 00:01 — forked from githubteacher/git-understanding-qs.md
Questions to check your understanding of some Git and GitHub concepts.

Beginner: Check for understanding

  1. (multiple answer) Git is:

    • a. A version control system
    • b. Centralized
    • c. Distributed
    • d. The same as GitHub
  2. (T/F) Git and GitHub are the same thing.

@ans1genie
ans1genie / SEO.md
Created October 30, 2020 23:55 — forked from denzildoyle/SEO.md
I short list of SEO tips and tricks I have learned over time

SEO

In this list, I will be typically be talking SEO as it relates to Google because Google will likely account for the vast majority of your inbound search traffic. Additionally, if you rank highly on Google, you will probably do well on other search engines anyway. Just like in football if you could play in the Major league you would most likely kill it in the minor league I would begin by explaining why SEO is important talk a little bit about what SEO is about and talk about how those concepts relate to the world wide web. Then talk about some of the things you could do to optimize your site from top to bottom of a typical webpage.

Why it's important

  • When you want to hide something on google put it on the second page. #SEO @searchdecoder
  • Winner takes almost everything
  • More than 80 percent of shoppers research big purchases online first
  • Opertunity for business
  • 88% Of Consumers Trust Online Reviews As Much As Personal Recommendations
  • 72% Of Consumers Say That Positive Reviews Make Them T
@ans1genie
ans1genie / mongo_dump_restore.md
Created August 16, 2020 16:57 — forked from saggiyogesh/mongo_dump_restore.md
Mongodb dump and restore from mlab
  • install mongodb on local machine (mongodump & mongorestore) commands are required.
  • command dumping

mongodump -h xxx11.mlab.com:11 -u user -p password --authenticationDatabase release-db -d release-db -o /home/dumps

**Options** `-h`: mlab host:port, `-u`: db user, `-p`: db user password, `--authenticationDatabase` `-d`: mlab dbname, `-o`: path to store backupfiles
  • restore command, to restore locally

    mongorestore --db dname /home/dumps

Otherwise to restore in mlab, create a new db and replace the options

@ans1genie
ans1genie / remove-all-from-docker.sh
Created August 16, 2020 15:35 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@ans1genie
ans1genie / gist:4714f46f7fcd093427e5ac0ab1d52626
Created April 13, 2020 00:04 — forked from pditommaso/gist:2265496
Read/write input/output stream of interactive process
import java.io.*;
public class TestProcessIO {
public static boolean isAlive(Process p) {
try {
p.exitValue();
return false;
}
catch (IllegalThreadStateException e) {
@ans1genie
ans1genie / create_json_paths.py
Created May 2, 2019 13:00 — forked from spareslant/create_json_paths.py
Creates Full paths from root node to leaf node in a JSON file
#! /usr/bin/env python
# This programm will create paths from root nodes to leafnodes along with values from any json file or structure.
import json
import pprint
json_data = open('sample_json_file.json', 'r').read()
json_dict = json.loads(json_data)
@ans1genie
ans1genie / docker_wordpress.md
Created February 13, 2019 05:12 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@ans1genie
ans1genie / http_status.php
Created November 3, 2018 22:51 — forked from simoebenhida/http_status.php
HTTP STATUS RESPONSES
<?php
//HTTP STATUS RESPONSES
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
103 => 'Early Hints',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',