Skip to content

Instantly share code, notes, and snippets.

View elbakly's full-sized avatar
🐳

Mostafa El Bakly elbakly

🐳
View GitHub Profile
(function($) {
function addUL(parent) {
var $ul = $("<ul/>");
var baseId = "_" + $(parent).attr("id");
$(parent).children("option,optgroup").each(function(index, tag) {
if (tag.tagName.toLowerCase() === "option") {
var $option = $(this);
var id = baseId + index;
var $li = $("<li/>").appendTo($ul);
@elbakly
elbakly / pre-commit
Created January 31, 2016 16:58 — forked from martinbean/pre-commit
Pre-commit hook to detect if any files contain dd()
#!/usr/bin/php
<?php
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD | grep "\.php$"');
$files = explode("\n", trim($files));
$exitCode = 0;
foreach ($files as $file) {
if (empty($file)) {