Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / process-user-input.py
Created December 15, 2020 17:24
process user input #hackerrank
##
# my_array = list (map (int, input().strip().split())) [:I]
#
## driver variables to test
n = 3
my_array = ' 1 6 8 '
# 1. input() function - to get user input from STDIN
@xbns
xbns / sakila-data.sql
Last active December 16, 2020 20:29
Sakila Database #database #schema #test-data
-- Sakila Sample Database Schema
-- Version 1.0
-- Copyright (c) 2006, 2015, Oracle and/or its affiliates.
-- All rights reserved.
-- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
@xbns
xbns / world-schema.sql
Created December 16, 2020 20:30
World Schema #database #schema
-- MySQL dump 10.13 Distrib 5.1.51, for pc-linux-gnu (i686)
--
-- Host: 127.0.0.1 Database: world
-- ------------------------------------------------------
-- Server version 5.1.51-debug-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES latin1 */;
@xbns
xbns / cloudSettings
Last active December 19, 2020 00:25
VS Code Setting #settings
{"lastUpload":"2020-12-18T21:25:40.250Z","extensionVersion":"v3.4.3"}
@xbns
xbns / arch-install-gpt-synopsis.md
Last active December 30, 2020 01:13
Simple way to Install Arch Linux on UEFI system

Step 1 Connect to internet from install disk or usb

Start iwd.service and connect your wifi

# systemctl start iwd.service
# systemctl status iwd.service
# iwctl --passphrase <you_wifi_password> station <name_of_station> connect <wifi_name>
# timeout 2 ping google.com
@xbns
xbns / pretty-powershell.md
Last active May 20, 2021 05:54
#powershell #windows Pretty Powershell Prompt

Make a pretty powershell prompt using delugia nerd font, oh-my-posh and jandedobbeleer theme

Delugia Nerd Font has support for gylphs

1. Install Git

winget install Git

2. Install oh-my-posh module

@xbns
xbns / pandoc-docx-docx.bat
Created May 24, 2021 06:37
#batch convert from docx to docx using pandoc
:: 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=