Skip to content

Instantly share code, notes, and snippets.

View KhalilZaidoun's full-sized avatar

Khalil Zaidoun KhalilZaidoun

View GitHub Profile
@KhalilZaidoun
KhalilZaidoun / countryCode.json
Created November 1, 2017 10:55
List of country codes
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
@KhalilZaidoun
KhalilZaidoun / .gitignore
Created April 11, 2017 09:32 — forked from jonathandixon/.gitignore
Cordova CLI project .gitignore and helper script. Useful when you don't want to commit the platforms and plugins directories to version control. http://stackoverflow.com/q/17911204/417568
platforms/
plugins/
@KhalilZaidoun
KhalilZaidoun / StoreHelper.ts
Created February 23, 2017 07:47
Reactive store helper In Angular2 [ From Angular-class]
import { Injectable } from '@angular/core';
import { Store } from '../store';
@Injectable()
export class StoreHelper {
constructor(private store: Store) {}
update(prop, state) {
const currentState = this.store.getState();
this.store.setState(Object.assign({}, currentState, { [prop]: state }));
}
add(prop, state) {
@KhalilZaidoun
KhalilZaidoun / GitCheatSheet.md
Last active October 31, 2018 16:24
Git Cheat Sheet

Create a Repository

Create an empty Git repository

git init [my_project]

Clone an external Git repository

git clone link.to.repository.git

Observe your Repository

@KhalilZaidoun
KhalilZaidoun / patterns.js
Created December 24, 2016 09:18
Useful Regex Patterns (Forked from Regex Hub)
export const patterns = [{
name:"Date in format dd/mm/yyyy",
regex:/^(0?[1-9]|[12][0-9]|3[01])([ /\-])(0?[1-9]|1[012])\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9])?$/,
description:"Will match dates with dashes, slashes or with spaces (e.g. dd-mm-yyyy dd/mm/yyyy dd mm yyyy), and optional time separated by a space or a dash (e.g. dd-mm-yyyy-hh:mm:ss or dd/mm/yyyy hh:mm:ss).",
tags:"date,time"
},
{
name:"Time in 24-hour format",
regex:/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/,
description: "Match times in 24 hour format",
@KhalilZaidoun
KhalilZaidoun / sh
Created December 2, 2016 20:33 — forked from rexlow/md
Run React Native on specific iOS simulator version
//by default
//react-native run-ios
//iPhone 4
react-native run-ios --simulator "iPhone ${1:-4}"
//iPhone 4s
react-native run-ios --simulator "iPhone ${1:-4s}"
//iPhone 5
@KhalilZaidoun
KhalilZaidoun / .editorconfig
Created September 25, 2016 18:42
File setting end-of-line and indentation styles for JavaScript files.
# http://editorconfig.org
# A special property that should be specified at the top of the file outside of
# any sections. Set to true to stop .editor config file search on current file
root = true
[*]
# Indentation style
# Possible values - tab, space
indent_style = space
@KhalilZaidoun
KhalilZaidoun / request.js
Last active March 29, 2018 10:39
javascript native request utility
// For more documentations refer to https://github.github.io/fetch/
import 'whatwg-fetch';
/**
* Parses the JSON returned by a network request
*
* @param {object} response A response from a network request
*
* @return {object} The parsed JSON from the request
*/