Skip to content

Instantly share code, notes, and snippets.

View mohamedaboelmagd's full-sized avatar
🎯
Focusing

Mohamed Aboelmagd mohamedaboelmagd

🎯
Focusing
View GitHub Profile
@DoctorDerek
DoctorDerek / One-Liner to Use Set with an Array of Objects Unique Objects.js
Created November 4, 2020 19:57
Easy One-Liner to Use Set to Find Unique Objects within an Array of Objects by the Objects' Contents
const uniqueObjectsOneLiner = [
...new Set(objectsArray.map((o) => JSON.stringify(o))),
].map((string) => JSON.parse(string))
console.log(`${uniqueObjectsOneLiner.length} objects`)
// Output: 2 objects
console.log(...uniqueObjectsOneLiner)
// [ { id: 1, emoji: "🎸" }, { id: 2, emoji: "🎷" } ]
Serial Keys:
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD
GV7N2-DQZ00-4897Y-27ZNX-NV0TD
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0
GZ3N0-6CX0L-H80UP-FPM59-NKAD4
YY31H-6EYEJ-480VZ-VXXZC-QF2E0
ZG51K-25FE1-H81ZP-95XGT-WV2C0
VG30H-2AX11-H88FQ-CQXGZ-M6AY4
@bennadel
bennadel / app.component.ts
Created May 1, 2018 12:42
Creating A Medium-Inspired Text Selection Directive In Angular 5.2.10
// Import the core angular services.
import { Component } from "@angular/core";
// Import the application components and services.
import { TextSelectEvent } from "./text-select.directive";
// ----------------------------------------------------------------------------------- //
// ----------------------------------------------------------------------------------- //
interface SelectionRectangle {
@zenorocha
zenorocha / basic.md
Last active March 26, 2023 09:00
New Firebase Auth vs Old Firebase Auth
@jondejong
jondejong / HttpService.ts
Created June 2, 2016 20:13
Angular 2 HttpService example for URL prefixes and auth headers
@Injectable()
export class HttpService {
private urlRoot:String;
constructor(private _http: Http,
private userService:UserService) {
this.urlRoot = 'https://api.myapp.com';
if(host == 'localhost'){
this.urlRoot = 'http://localhost:4040';
@Humoud
Humoud / regex-arabic.md
Last active April 1, 2024 03:48
Detecting arabic characters with regex.

Detect all Arabic Characters:

/[\u0600-\u06ff]|[\u0750-\u077f]|[\ufb50-\ufbc1]|[\ufbd3-\ufd3f]|[\ufd50-\ufd8f]|[\ufd92-\ufdc7]|[\ufe70-\ufefc]|[\uFDF0-\uFDFD]/

Summary:

  Arabic (0600—06FF, 225 characters)

  Arabic Supplement (0750—077F, 48 characters)
@anvaka
anvaka / 00.Intro.md
Last active November 15, 2024 07:27
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
@mxriverlynn
mxriverlynn / 1.js
Last active April 15, 2020 14:27
Standard deviation, in JavaScript
var sum = values.reduce(function(sum, value){
return sum + value;
}, 0);
var avg = sum / data.length;
@escapedcat
escapedcat / app.js
Created July 28, 2014 10:19
basic webpack angularjs example, based on phonecatApp tutorial (phonecat)
var phonecatAnimations = require("./animations.js");
var phonecatControllers = require("./controllers.js");
var phonecatFilters = require("./filters.js");
var phonecatServices = require("./services.js");
'use strict';
/* App Module */
var phonecatApp = angular.module('phonecatApp', [
@Chaser324
Chaser324 / GitHub-Forking.md
Last active November 14, 2024 08:32
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j