Skip to content

Instantly share code, notes, and snippets.

View mohshbool's full-sized avatar

Mohammad Shbool mohshbool

View GitHub Profile
#include <iostream>
using namespace std;
const int ROW_SIZE = 3;
const int COLUMN_SIZE = 3;
void CheckMatrix(int m[][COLUMN_SIZE], int ROW_SIZE)
{
if (COLUMN_SIZE != ROW_SIZE)
@mohshbool
mohshbool / main.cpp
Last active December 27, 2021 18:22
#include <iostream>
#include <cstring>
#include <regex>
#include <queue>
#include <stack>
using namespace std;
class UserAccountType
{
@mohshbool
mohshbool / input.js
Created May 12, 2019 12:49
React Native Input Component with Error messages and Icon support
import React from 'react'
import { View, Text, TextInput, StyleSheet} from 'react-native'
export default class Input extends React.Component {
focus() {
this.input.focus();
}
blur() {
this.input.blur();
@mohshbool
mohshbool / validateForm.js
Created April 18, 2019 16:24
Validate form function using jQuery@^3.x
const validateForm = () => {
$('input').each(function() {
const $this = $(this);
const $button = $('button');
if ($this.val() === '' || $this.val().length <= 0) {
$button.attr('disabled', 'disabled');
} else if (!$button.attr('disabled')) {
$button.removeAttr('disabled');
}
})
@mohshbool
mohshbool / ex26.rb
Created March 1, 2019 13:59
Exercise 26 in LearnRubyTheHardway solved
module Ex25
# This function will break up words for us.
def Ex25.break_words(stuff)
return stuff.split(' ')
end
# Sorts the words.
def Ex25.sort_words(words)
return words.sort()
// https://codeburst.io/javascript-array-distinct-5edc93501dc4
export const uniqueArray = (array) => {
console.log(array)
const result = []
const map = new Map()
for (const item of array) {
if(!map.has(item.imdbID)){
map.set(item.imdbID, true)
result.push({
imdbID: item.imdbID,