Skip to content

Instantly share code, notes, and snippets.

Bilal Haidar bhaidar

  • Remote
View GitHub Profile
bhaidar / git-helpers.plugin.zsh
Created May 27, 2020 — forked from clauswitt/git-helpers.plugin.zsh
Git zsh aliases and functions
View git-helpers.plugin.zsh
#git aliases
alias gsts='git status --short'
alias c='git commit '
alias gd='git diff '
alias clean='git clean -f'
alias gl='git l'
#git function to add last parameter of last command via git add (used after a diff)
gal() {
bhaidar /
Created Apr 7, 2020 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
View algo.js
function diffArray(arr1, arr2) {
let arr1UniqueItems = arr1.filter(item => arr2.indexOf(item) < 0);
let arr2UniqueItems = arr2.filter(item => arr1.indexOf(item) < 0);
return [...arr1UniqueItems, ...arr2UniqueItems];
bhaidar / random.js
Created Mar 18, 2020 — forked from kerimdzhanov/random.js
JavaScript: get a random number from a specific range
View random.js
* Get a random floating point number between `min` and `max`.
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
bhaidar / visual-ui-test-script
Last active Feb 25, 2020
Visual UI Test Script Appium Applitools AWS Device Farm
View visual-ui-test-script
"use strict";
;(async () => {
const webdriver = require("selenium-webdriver");
const LOCAL_APPIUM = "";
// Initialize the eyes SDK and set your private API key.
const { Eyes, Target, FileLogHandler, BatchInfo, StitchMode } = require("@applitools/eyes-selenium");
bhaidar /
Created Feb 8, 2020 — forked from remarkablemark/
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.


bhaidar /
Created Jan 25, 2020 — forked from 0xjac/
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)
    git clone --bare
bhaidar / circleci-config-yml
Created Dec 23, 2019
View circleci-config-yml
version: 2
working_directory: ~/applitools-github-circleci
- image: cypress/base:10
- checkout
- restore_cache:
bhaidar / sales-force-contact-form
Last active Dec 24, 2019
View sales-force-contact-form
/// <reference types="Cypress" />
context('Applitools', () => {
beforeEach(() => {
// Open the Applitools Test
appName: 'Applitools CircleCI',
browser: [
{ width: 800, height: 600, name: 'firefox' },
bhaidar / Postman POST PUT Requests.txt
Created Nov 21, 2019 — forked from ethanstenis/Postman POST PUT Requests.txt
How to make Postman work with POST/PUT requests in Laravel...
View Postman POST PUT Requests.txt
To make Postman work with POST/PUT requests...
In addition to checking for the CSRF token as a POST parameter, the Laravel VerifyCsrfToken middleware will also check for the X-CSRF-TOKEN request header.
1. Store the token in a "meta" tag at the top of your root view file (layouts/app.blade.php)...
<meta name="csrf-token" content="{{ csrf_token() }}">
** If using jQuery, you can now instruct it to include the token in all request headers.
You can’t perform that action at this time.