Skip to content

Instantly share code, notes, and snippets.

@xbns
xbns / simpleArraySum.md
Last active December 14, 2020 19:10
Problem : Simple Array Sum #hackerrank

Simple Array Sum

Given an array of N integers, can you find the sum of its elements?

Input Format

The first line contains an integer,N ,denoting the size of the array. he second line contains N space-separated integers representing the array's elements.

Output Format

@xbns
xbns / leapyear.md
Last active December 15, 2020 14:55
Problem: Leap Year #hackerrank

Problem: Leap Year

An extra day is added to the calendar almost every four years as February 29, and the day is a called a leap year.It corrects the calendar for the fact that our planet takes approximately 365.25 days to orbit the sun.A leap year contains a leap day.

In the Gregorian calendar,three conditions are used to identify leap year:

  • The year can be evenly divided by 4, is a leap year unless:
  • The year can be evenly divided by 100,it is NOT a leap year.
  • The year is also evenly divisible by 400.Then it is a leap year.

This means that in the Gregorian calendar,the years 2000 and 2400 are leap years,while

@xbns
xbns / README.md
Last active December 12, 2020 17:24
Data Driven Testing #csv #pytest #python

Install pytest & requests

# pip install pytest requests

How to run

$  pytest data-driven-testing.py
@xbns
xbns / README.md
Created December 12, 2020 10:27
[Fly For Less SQL Schema] Airport Database Schema #sql #schema

Exercise 3 - Select Practise

Create SQL queries to accomplish the following tasks using the fly for less database

  1. Select all the records from the price table.

  2. Select just the names of all the cities

  3. Select the IATA code and details of all the terminals

@xbns
xbns / README.md
Last active December 12, 2020 12:12
[Address Book SQL Schema] #sql #schema

Learn SQL

Exercise 1 - Design an Address Book Database

Create a set of tables to store data for an address book(contact) application Bare in mind the following design criteria

  1. The application will be used by multiple people so the database should also store a list of users

  2. The people(contacts) in the database will be owned by only one user - 1 to 1 relationship

@xbns
xbns / simple-test.py
Created December 11, 2020 10:34
[simple test] example test using pytest_server,unittest and requests libraries
import requests
import unittest
from pytest_httpserver import HTTPServer
import json
class APITest(unittest.TestCase):
def test_my_client(self):
with HTTPServer() as httpserver:
# set up the server to serve "/" with the json
httpserver.expect_request('/content').respond_with_json({'result': 30})
@xbns
xbns / pandoc-docx-md.bat
Created December 10, 2020 23:03
[Pandoc Conversion] convert form markdown to docx format #script #batch
:: pandoc-docx-md.bat
::
:: Don't show these commands to the user
@ECHO off
:: Set the title of the window
TITLE Convert docx to markdown with Pandoc
:: Select file marker
:selectfile
:: Clear any preexisting filename variables
SET filename=
@xbns
xbns / why-this-partitioning-scheme.md
Last active August 4, 2024 12:09
Why this partitioning scheme #arch-linux

Why this partitioning scheme

Laptop 1: hp-4540s-i5 (BIOS/MBR)

$ sudo dmidecode | grep -A3 '^System Information'
System Information
@xbns
xbns / arch-linux-installation-on-mbr-system.md
Last active February 6, 2025 04:59
Arch Linux Installation Process for a Legacy/BIOS/MBR System #arch-linux

Arch Linux Installation Process for a Legacy/BIOS/MBR System

We will tackle this process in 10 steps listed below.

I didn't want to repeat some sections well explained in the UEFI Process. You can refer there and follow due process.

Namely;

  • Connecting to WiFi.
@xbns
xbns / arch-linux-installation-on-uefi-gpt-system.md
Last active April 3, 2025 08:07
Installing Arch Linux for UEFI/GPT System #arch-linux

Installing Arch Linux for UEFI/GPT System

For BIOS/MBR Legacy system refer to here

Installation process over a Wi-Fi

Download the .iso file from Arch Linux Official Site.

Step 1: Make a Live USB Disk and boot from it.