Skip to content

Instantly share code, notes, and snippets.

View benbowler's full-sized avatar

Ben Bowler benbowler

View GitHub Profile
@benbowler
benbowler / names.txt
Last active April 17, 2020 06:47 — forked from mahemoff/names.txt
Reserved username list
###
A meta-compilation of:
https://raw.github.com/gist/1453705/d253733a56632a8d2c29321a75c18b627fa4dda8/reserved_usernames.rb
http://blog.postbit.com/reserved-username-list.html
http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
(Took out some company-specific terms at the top of the first one (e.g. imulus, stacks), added one term so far - 'edits'.)
NOTE: Does not include profanities. You may or may not want to add a list of those.
(See https://www.google.com/search?q=profanity+list, but don't try to apply regexp's here because Scunthorpe - http://en.wikipedia.org/wiki/Scunthorpe_problem)
[
"about",
"ac",
"access",
"account",
"accounts",
"activate",
"ad",
"add",
"address",
@benbowler
benbowler / thinkific-cross-domain-tracking-google-analytics.js
Created March 30, 2017 11:05
Cross domain tracking Google Analytics code for Thinkific in the multi-tenant tag format.
<!--
Ben's custom GA Code for Thinkific, please don't change!
Satisfies both of these criteria:
https://www.en.advertisercommunity.com/t5/Google-Analytics-Code/Help-with-multi-tenant-google-analytics-access/td-p/515546#
https://support.google.com/analytics/answer/1034342?hl=en
-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@benbowler
benbowler / vagrant-xdebug-qcachegrind-setup.md
Last active February 21, 2017 16:53
Enabling Xdebug on Vagrant and Profiling on Qcachegrind for Mac

To test the performance of the importer plugin I enabled Xdebug which is included in Vagrant's install of PHP. All you have to do to enable it is add the following lines to the php.ini file. Which is either etc/php/5.6/cli/php.ini for command line or etc/php/5.6/fpm for nginx. If enabling for nginx you need to restart nginx and php-fpm for it to take effect.

[xdebug]
xdebug.remote_autostart=1
xdebug.profiler_enable=1
xdebug.profiler_append=0
xdebug.profiler_output_dir ="/vagrant/web/app/plugins/agreable-catfish-importer-plugin/testing"
xdebug.profiler_output_name = "callgrind.out.%t-%s"
; For extra points you can also link xdebug with Atom, Sublime Text or NetBeans IDEs
@benbowler
benbowler / Install composer on Amazon AMI running on EC2
Created December 28, 2016 15:25 — forked from asugai/Install composer on Amazon AMI running on EC2
Install composer on Amazon AMI running on EC2
cd ~
sudo curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@benbowler
benbowler / install-apache-php-amazon-linux.sh
Last active December 28, 2016 15:22
How to setup Apache and PHP on Amazon Linux (AWS)
#!/bin/sh
# Based on http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Tutorials.WebServerDB.CreateWebServer.html
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
yum update -y
@benbowler
benbowler / install-ffmpeg-amazon-linux.sh
Last active December 28, 2016 15:34 — forked from alfonsodev/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh
# and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# updated with mirror source post rpmforge https://github.com/repoforge/rpms/issues/375
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
## Customized for Laravel 4
# setting worker_processes to CPU core count
worker_processes 1;
daemon off;
events {
worker_connections 1024;
}
@benbowler
benbowler / gist:6388643
Last active December 22, 2015 00:19
My Favorite Sublime Text 2 Commands

Convert selection to uppercast and lowercase

apple + k u apple + k l

Cursor to all lines

apple + alt + l

Select next occurance of selection

@benbowler
benbowler / gist:6284613
Created August 20, 2013 17:34
Fix line breaks for git
find . -type f -exec grep -qIP '\r\n' {} ';' -exec perl -pi -e 's/\r\n/\n/g' {} '+'