Skip to content

Instantly share code, notes, and snippets.

View adil1214's full-sized avatar
:electron:

ADIL adil1214

:electron:
  • Home GmbH
  • Casablanca, Morocco.
View GitHub Profile
## How to hide API keys from github ##
1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while
retaining your commits: https://help.github.com/articles/remove-sensitive-data/
2. In the terminal, create a config.js file and open it up:
touch config.js
atom config.js
@adil1214
adil1214 / .gitignore
Created October 28, 2017 18:18 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
/*input
3 3
1 3 4
2 2 3
1 2 4
*/
// expected output is 60
#include <bits/stdc++.h>
@adil1214
adil1214 / GitHub-Forking.md
Created July 3, 2018 14:52 — forked from Chaser324/GitHub-Forking.md
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

@adil1214
adil1214 / README-Template.md
Created August 24, 2018 15:23 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

/*
// egghead playlist
// https://egghead.io/courses/advanced-react-component-patterns
*/
let a = 0;
[...document.getElementsByClassName('w-100 pa1 tl mv0 flex flex-row items-center no-underline dark-gray h2')]
.map((e) => e.innerText )
.forEach((d) =>
@adil1214
adil1214 / Firebase Database API Cheatsheet
Created October 9, 2018 15:35 — forked from odigity/Firebase Database API Cheatsheet
Firebase Database API Cheatsheet
There is no way to store an empty object/array/null value.
There are also no actual arrays. Array values get stored as objects with integer keys.
(If all keys are integers, it will be returned as an array.)
Basically, it's one giant tree of hashes with string keys.
Simply write a value to any location, and the intermediary locations will automatically come into existance.
── Classes ──
DataSnapshot : Container for a subtree of data at a particular location.
@adil1214
adil1214 / jsonStringifyAlt.js
Created October 13, 2018 09:48
a JSON.stringify alternative to convert circular object structures to json.
// converting circular structure to json
// source: https://stackoverflow.com/a/48254637/8717257
const customStringify = function (v) {
const cache = new Set();
return JSON.stringify(v, function (key, value) {
if (typeof value === 'object' && value !== null) {
if (cache.has(value)) {
// Circular reference found, discard key
return;
}
@adil1214
adil1214 / list.txt
Created December 20, 2018 22:57
reading lines 2 by 2
user1
password1
user2
password2
user3
password3
user4
password4
user5
password5
@adil1214
adil1214 / mongo_dump_restore.md
Created January 6, 2019 17:19 — forked from saggiyogesh/mongo_dump_restore.md
Mongodb dump and restore from mlab
  • install mongodb on local machine (mongodump & mongorestore) commands are required.
  • command dumping

mongodump -h xxx11.mlab.com:11 -u user -p password --authenticationDatabase release-db -d release-db -o /home/dumps

**Options** `-h`: mlab host:port, `-u`: db user, `-p`: db user password, `--authenticationDatabase` `-d`: mlab dbname, `-o`: path to store backupfiles
  • restore command, to restore locally

    mongorestore --db dname /home/dumps

Otherwise to restore in mlab, create a new db and replace the options