Skip to content

Instantly share code, notes, and snippets.

View MohamedLamineAllal's full-sized avatar

Mohamed Lamine Allal MohamedLamineAllal

View GitHub Profile
@MohamedLamineAllal
MohamedLamineAllal / List.md
Created December 18, 2017 22:29 — forked from msurguy/List.md
List of open source projects made with Laravel

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@MohamedLamineAllal
MohamedLamineAllal / vanilla-js-cheatsheet.md
Created January 11, 2018 11:11 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@MohamedLamineAllal
MohamedLamineAllal / defineProperty.js
Created January 13, 2018 23:20 — forked from afuggini/defineProperty.js
Object.defineProperty polyfill
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
@MohamedLamineAllal
MohamedLamineAllal / bash_profile.md
Created February 28, 2018 20:14 — forked from ankurk91/bash_profile.md
:octocat: Git branch name in Linux/Mac Terminal

Mac OS : Show your git branch name on your terminal

Add these lines in your ~/.bash_profile file

# Show current git branch name
parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@MohamedLamineAllal
MohamedLamineAllal / .bashrc
Created February 28, 2018 20:34 — forked from lukaswilkeer/.bashrc
Gnome terminal with colors and git branch.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
#define GIT_COLOR_NORMAL “”
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
@MohamedLamineAllal
MohamedLamineAllal / README-Template.md
Created March 20, 2018 21:17 — 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

@MohamedLamineAllal
MohamedLamineAllal / VSCodeExtension.py
Created May 13, 2018 17:51 — forked from harry-cpp/VSCodeExtension.py
VSCode extension for Nautilus
# VSCode Nautilus Extension
#
# Place me in ~/.local/share/nautilus-python/extensions/, restrart Nautilus, and enjoy :)
# mkdir -p ~/.local/share/nautilus-python/extensions && cp -f VSCodeExtension.py ~/.local/share/nautilus-python/extensions/VSCodeExtension.py && nautilus -q
#
# This script was written by cra0zy and is released to the public domain
from gi import require_version
require_version('Gtk', '3.0')
require_version('Nautilus', '3.0')
@MohamedLamineAllal
MohamedLamineAllal / revert-a-commit.md
Created June 3, 2018 00:03 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@MohamedLamineAllal
MohamedLamineAllal / node-folder-structure-options.md
Created June 7, 2018 18:39 — forked from lancejpollard/node-folder-structure-options.md
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
@MohamedLamineAllal
MohamedLamineAllal / animatedScrollTo.js
Created July 4, 2018 14:16 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;