Skip to content

Instantly share code, notes, and snippets.

View bdsexton's full-sized avatar

Brian Sexton bdsexton

View GitHub Profile
JohnnyQQQQ / draganddrop.js
Last active December 12, 2015 09:29
simple snippet and demo for a drag and drop motion in casperjs
var casper = require('casper').create();
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)');
casper.viewport(1024, 768);
casper.thenOpen('', function() {
getify / gist:675496
Created November 13, 2010 17:18
detecting if flash plugin is installed
var _flash_installed = ((typeof navigator.plugins != "undefined" && typeof navigator.plugins["Shockwave Flash"] == "object") || (window.ActiveXObject && (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) != false));
ihor /
Last active July 13, 2018 19:27
/etc/init.d/mysql script for Homebrew installed MySQL
test -x $DAEMON || exit 0
set -e
cristianciofu / phpDateTimeMondayFirstDay.php
Created June 22, 2013 10:48
Change php's DateTime behavior to use Monday as first day of the week
// found it here :
class EuroDateTime extends DateTime {
// Override "modify()"
public function modify($string) {
fideloper /
Created June 6, 2012 02:24
You should develop in a Virtual Machine

#You should do all your LAMP development in a Virtual Machine

##Here's Why:

Many of us develop on Macintoshes. There are many reasons for this, but one of them is that it's based on a Unix platform of some sort. This allows us to run common server software such as Apache, Ruby, Python and Nodejs on our Macs.

Our computers become powerful develoment machines similar to the servers our apps will eventually live on.

Sometime we start our computer only to find Apache won't start, or MySQL can't create a PID file, or we've updated to Mountain Lion and Apache needs to be reconfigured. Death!

frankleromain / 403forbidden.php
Created April 14, 2012 20:25
Creating a Secure PHP Login Script
header('HTTP/1.1 403 Forbidden');
<title>Congratulations! You have been DENIED access</title>
<font size="4">You have been denied access because of the following reasons:<br /><br />
1.) Too many failed login attempts, so you are likely brute forcing through logins.<br />
toddmotto / *.md
Last active April 25, 2023 09:06
Component versus Directive in AngularJS

Component versus Directive in AngularJS


Components are not "helper" methods, they are the best change in Angular 1.x since I've been using it.

What is the role of .component()?

  • Declares new HTML via a template or templateUrl
  • Should be used to create Components as part of a Component architecture
nrollr /
Last active March 11, 2024 13:32
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

jonathantneal /
Last active March 19, 2024 23:31
Local SSL websites on macOS Sierra

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\"
rhukster /
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to
# Creator: Phil Cook
# Modified: Andy Miller
# >>> IMPORTANT: Moved to:
# >>> Kept here for legacy purposes
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)