Skip to content

Instantly share code, notes, and snippets.

Shane Perera shanecp

View GitHub Profile
shanecp / gist:db18c9fe5889e123d729aa110d5e807a
Created Apr 24, 2019
Freeze Google chrome to inspect the contents
View gist:db18c9fe5889e123d729aa110d5e807a
setTimeout(function(){debugger;}, 5000);
shanecp / Intersect
Created Apr 14, 2019
Recursive Intersect for array subsets in PHP. Pass an array and a subset of an array. Returns the matching subset if it intersects.
View Intersect
namespace App\Domain;
class Intersect
shanecp / domdetailer.php
Created Apr 9, 2018
DomDetailer PHP Code
View domdetailer.php
$results = [];
if (!empty($_POST['domains'])) {
$apiKey = 'INSERT_API_KEY';
$domains = explode("\n", $_POST['domains']);
foreach ($domains as $domain) {
shanecp /
Last active Dec 22, 2017
nginx Configuration for WordPress subfolders

Setup WordPress in nginx within a subfolder. This example does the redirect to a folder called /blog. So you can have one installation at / and another at /blog Change [sitename].dev to the domain.

server {
	listen 80;
	listen [::]:80;
	server_name     [sitename] www.[sitename];
    	# redirect all http traffic to https
	return          301 https://www.$server_name$request_uri;
shanecp / 0_reuse_code.js
Created Mar 12, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
shanecp /
Created Mar 12, 2016
Error: `libsass` bindings not found. Try reinstalling `node-sass`?

Error: libsass bindings not found. Try reinstalling node-sass?

npm uninstall --save-dev gulp-sass
npm install --save-dev gulp-sass

or try deleting node_modules and running npm install again. The cause of this is a conflict between node + npm + node-sass + gulp-sass.

shanecp / .bash_profile
Created Nov 27, 2015
.bash_profile for Terminal on OSX
View .bash_profile
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from
alias a='php artisan'
alias reseed='php artisan migrate:refresh --seed'
alias cept='vendor/bin/codecept'
alias ioios='ionic run ios -l -c'
shanecp / git
Created Aug 8, 2015
Clone GIT repo to your current directory
View git
git clone your-repo tmp && mv tmp/.git . && rm -rf tmp && git reset --hard
shanecp / implode.js
Created Mar 31, 2015
LoDash - extension for implode (similar to PHP function)
View implode.js
implode: function (glue, collection) {
glue = glue || '';
if (!_.isArray(collection)) return false;
if (collection.length == 1) return collection[0];
var returnString = '';
shanecp / gulpfile.js
Last active Jan 9, 2016 — forked from ognjenm/watch.js
Laravel 5 Elixir with LiveReload custom task
View gulpfile.js
// require the file
// Call the new task in Laravel Elixir file
elixir(function(mix)) {;
You can’t perform that action at this time.