Skip to content

Instantly share code, notes, and snippets.

View gormus's full-sized avatar
💭
Never be cruel, never be cowardly.

Osman Gormus gormus

💭
Never be cruel, never be cowardly.
View GitHub Profile
@gormus
gormus / changelog.rb
Created November 16, 2017 05:49 — forked from ttscoff/changelog.rb
Generate release notes from git commit messages
#!/usr/bin/ruby
# A script to automate changelog generation from Git commit messages
#
# For use with a git-flow workflow, it will take changes from the last tagged release
# where commit messages contain NEW, FIXED, and IMPROVED keywords and sort and fromat
# them into a Markdown release note list.
#
# The script takes version information from the macOS command agvtool and bases
# the product name on the first matching Xcode Info.plist found
@gormus
gormus / DomainBlackListValidator.php
Created January 14, 2018 20:07
Laravel validation rule to prevent use of email addresses possessing a disposable (blacklisted) domains.
<?php
// Namespace
namespace App\Validators;
// Using directives
use Cache;
use Carbon\Carbon;
// Domain black list validation class
@gormus
gormus / LinkModifierService.php
Created April 19, 2018 14:59 — forked from hudri/LinkModifierService.php
Modify _all_ Drupal links
<?php
namespace Drupal\wt_base;
use Symfony\Component\HttpFoundation\RequestStack;
use Drupal\Core\PathProcessor\OutboundPathProcessorInterface;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Core\Render\BubbleableMetadata;
/**
* Class DefaultService.
@gormus
gormus / pretty-php-date-ranges.php
Created July 10, 2018 04:59 — forked from jb510/pretty-php-date-ranges.php
Pretty PHP Date Ranges
<?php
/**
* Verbose Beautified Date Range
*
* @access public
* @param mixed $start_date
* @param mixed $end_date
* @return $date_range (beautified date range)
* @license WTFPL
*
@gormus
gormus / qs.js
Created November 14, 2018 19:10 — forked from cvan/qs.js
get query-string parameters (alternative to `URLSearchParams`)
var queryParams = window.location.search.substr(1).split('&').reduce(function (q, query) {
var chunks = query.split('=');
var key = chunks[0];
var value = chunks[1];
return (q[key] = value, q);
}, {});