This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if [ 0 == $# ]; then | |
echo -n "Provide Process String:" | |
read PROCESS | |
else | |
PROCESS="$1" | |
fi | |
if [[ -z $PROCESS ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The MIT License (MIT) | |
# Copyright (c) 2013 Alvin Abad | |
if [ $# -eq 0 ]; then | |
echo "Git wrapper script that can specify an ssh-key file | |
Usage: | |
git.sh -i ssh-key-file git-command | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# The MIT License (MIT) | |
# Copyright (c) 2014 Roni Saha<roni.cse@gmail.com> | |
# May need to run this as sudo! | |
# Copy it in global path (like /usr/local/bin) and run command 'vhost' from anywhere, using sudo. | |
# | |
# Show Usage, Output to STDERR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
E_BAD_ARGS=85 | |
E_BAD_PATH=-1 | |
if [ ! -n "$1" ] | |
then | |
echo "Usage: $0 dir1 dir2 etc." | |
exit ${E_BAD_ARGS} | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -n "Enter github Username: " | |
read USER_NAME | |
echo -n "Enter github repository name: " | |
read REPO_NAME | |
echo -n "Enter Password:" | |
read -s PASSWORD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
function fileLocator($file =null, $maxDepth = 10, $currentDir = ".") | |
{ | |
if(empty($file)){ | |
return false; | |
}elseif(file_exists($currentDir . "/$file")){ | |
return $currentDir; | |
}elseif(--$maxDepth){ | |
return fileLocator($file, $maxDepth, $currentDir . "/.."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class EasyCSVIterator implements \Iterator { | |
protected $file; | |
protected $key = 0; | |
protected $current; | |
protected $header; | |
protected $hasHeader; | |
public function __construct($file, $hasHeader = false) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyProject\Bundle\MyBundle\Resolver; | |
use Symfony\Component\EventDispatcher\Event; | |
use Xiidea\EasyAuditBundle\Events\DoctrineEntityEvent; | |
use Xiidea\EasyAuditBundle\Resolver\EntityEventResolver as BaseResolver; | |
class EntityEventResolver extends BaseResolver | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- `Enable` script generator. | |
-- Must be run before disable. This will ensure you donot enable any already disabled key while restoring | |
SELECT | |
'ALTER TABLE ' || OWNER || '.' || table_name || ' enable CONSTRAINT ' || constraint_name || ';' | |
FROM dba_constraints WHERE constraint_type = 'R' and status = 'ENABLED' AND OWNER='__OWNER_NAME__'; | |
--`Disable` script generator | |
select | |
'ALTER TABLE ' || OWNER || '.' || table_name || ' disable CONSTRAINT ' || constraint_name || ';' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CKEDITOR.on('instanceReady', function(ev) { | |
var editor = ev.editor; | |
editor.on('key', function (event) { | |
setTimeout(function () { | |
var edata = editor.getData(); | |
var replaced_text = edata.replace("#1", "one"); // you could also use a regex in the replace |
OlderNewer