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
$str_pos_array = function ($haystack, $needles=[], $offset=0) { | |
$characters = []; | |
foreach($needles as $needle) { | |
$res = strpos($haystack, $needle, $offset); | |
if ($res !== false) { | |
$characters[$needle] = $res; | |
} |
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
(function (){ | |
var newcss = ".mouseOn{background-color: #bcd5eb !important;outline: 2px solid #5166bb !important;}"; | |
if ('\v'=='v') /* ie only */ { | |
document.createStyleSheet().cssText = newcss; | |
} else { | |
var tag = document.createElement('style'); | |
tag.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(tag); | |
tag[ (typeof document.body.style.WebkitAppearance=='string') /* webkit only */ ? 'innerText' : 'innerHTML'] = newcss; | |
} |
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 | |
# Author: Michael Gray | |
# Description: The purpose of this script is to allow Atlassian Stash to send post-receive hooks to PHPCI | |
# using the external post-receive POST hook request. | |
# Email: hello@graymic.co.uk | |
( | |
PROJECT_ID=$1 | |
PHPCI_URL="http://path.to.ci.server.com" | |
echo "Script name: $0" | |
echo "Positional arguments: ${@}" |
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 | |
wget http://git-core.googlecode.com/files/git-1.8.3.4.tar.gz | |
wget -O git-manpages-1.8.3.4.tar.gz http://code.google.com/p/git-core/downloads/detail?name=git-manpages-1.8.3.4.tar.gz&can=2&q= | |
sudo yum install zlib-devel perl-CPAN gettext | |
tar xvfz git-1.8.3.4.tar.gz | |
cd git-1.8.3.4 | |
./configure |
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
echo "export PATH=/Applications/MAMP/bin/php/php5.*.*/bin:$PATH" >> ~/.bash_profile | |
source ~/.bash_profile |
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 bash | |
command -v gem >/dev/null 2>&1 || { echo >&2 "Gem not installed, exiting."; exit 1; } | |
command -v cap >/dev/null 2>&1 || { | |
echo >&2 "Capistrano is required for deployments. Installing capistrano now..."; | |
gem install capistrano | |
} | |
if [ ! -d ".deploy" ]; then | |
echo ".deploy directory has not been setup. Please run the cap installer." |
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
var gulp = require('gulp'), | |
sass = require('gulp-sass'), | |
minify = require('gulp-minify-css'), | |
concat = require('gulp-concat'), | |
uglify = require('gulp-uglify'), | |
rename = require('gulp-rename'), | |
notify = require('gulp-notify'), | |
growl = require('gulp-notify-growl'), | |
phpunit = require('gulp-phpunit'), | |
prefix = require('gulp-autoprefixer'), |
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 | |
// You can ofc ignore this and load it in from the default .env file, however I prefer this method for load dot files. | |
// Dotenv::load(__DIR__.'/../'); | |
// Dotenv::require('APP_ENV'); | |
$dotenv = function () { | |
$env = getenv('APP_ENV') ?: 'local'; | |
if (file_exists(__DIR__.'/../')) { | |
Dotenv::load(__DIR__.'/../', '.env.' . $env); | |
} |
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 app\Acme\Repositories; | |
/** | |
* Class EloquentRepository | |
* @package app\Acme\Repositories | |
*/ | |
abstract class EloquentRepository { | |
/** | |
* @var $model \Eloquent; |
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 Some\Extended\Models\Namespace; | |
class MyBespokeModel extends Some\Other\Parent\Namespace\Model { | |
/** | |
* As this class is \App\Api\Models - Map the polymorphic relationship to this model | |
* so that it can be accessed either by Common\Models or Api\Models. | |
* | |
* @var string | |
*/ |
OlderNewer