Skip to content

Instantly share code, notes, and snippets.

View mqanneh's full-sized avatar
:octocat:
Coding

Mohammad AlQanneh mqanneh

:octocat:
Coding
View GitHub Profile
#!/bin/sh
#
# This hook prevents you from committing any file containing the
# words "do not commit".
#
# The idea is that I can add a comment to prevent myself from
# committing a change related to debugging or hacking.
#
# To enable this hook, rename this file to ".git/hooks/pre-commit".
find ./ -type d -name 'migration_templates'
@mqanneh
mqanneh / __INDEX.txt
Created December 29, 2016 15:43 — forked from facine/__INDEX.txt
Drupal 8 - Examples
# Taxonomy terms:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_taxonomy_term-php
# Menu links:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_menu_link-php
# File items:
- https://gist.github.com/facine/35bb291811c146b6fc9e#file-create_file-php
# Nodes:
@mqanneh
mqanneh / README.markdown
Created October 11, 2017 21:43 — forked from marijn/README.markdown
List of nationalities in YAML, CSV and TXT format

List of nationalities

It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.

List of countries

I've also compiled a list of countries

@mqanneh
mqanneh / README.markdown
Created October 11, 2017 21:43 — forked from marijn/README.markdown
List of nationalities in YAML, CSV and TXT format

List of nationalities

It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.

List of countries

I've also compiled a list of countries

@mqanneh
mqanneh / drupal8-links.php
Created December 13, 2017 10:47 — forked from colorfield/drupal8-links.php
Drupal 8 links, or where is my l() function
@mqanneh
mqanneh / git-commit-log-stats.md
Created February 15, 2018 13:38 — forked from eyecatchup/git-commit-log-stats.md
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@mqanneh
mqanneh / relative-time.php
Created February 18, 2018 08:22 — forked from mtttmpl/relative-time.php
Get Relative Time in PHP (e.g. '1 hour ago', 'yesterday', 'tomorrow', 'in 2 weeks')
<?php
function time2str($ts) {
if(!ctype_digit($ts)) {
$ts = strtotime($ts);
}
$diff = time() - $ts;
if($diff == 0) {
return 'now';
} elseif($diff > 0) {
$day_diff = floor($diff / 86400);
@mqanneh
mqanneh / gen-d8-salt.sh
Created July 20, 2018 11:13 — forked from pfaocle/gen-d8-salt.sh
Generate Drupal 8 hash salt
drush eval "var_dump(Drupal\Component\Utility\Crypt::randomBytesBase64(55))"
@mqanneh
mqanneh / the original guy used autocrlf false
Created August 11, 2018 14:24 — forked from anaisbetts/the original guy used autocrlf false
.gitattributes to solve your problems
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain