Skip to content

Instantly share code, notes, and snippets.

View chrisjordanme's full-sized avatar

Chris Jordan chrisjordanme

View GitHub Profile
@chrisjordanme
chrisjordanme / gist:b416b963e58a3cca14593b1f5c7cab8c
Last active October 28, 2017 18:40
An opinionated bash function to expedite the installation and configuration of new WordPress sites in a local development environment. The script clones a fork of Mark Jaquith's WordPress Skeleton project, pulls in WordPress as a submodule, then writes the local-config file while also creating a new local MySQL database and sets up user perms.
# WordPress fast local installation to kickstart new sites fast. This uses a fork of Mark Jaquith's WP Skeleton as the foundational structure of the WP install.
function wpinstall() {
# Go get all the things
git clone git@github.com:chrisjordanme/WordPress-Skeleton.git;
cd WordPress-Skeleton/wp;
git submodule init && git submodule update;
# Collect inputs needed for installation/config
echo "Success! WordPress has successfully been installed. Now tell me, what is the name of your new database that this site will need?";
read dbnew;
@chrisjordanme
chrisjordanme / cloudSettings
Last active December 13, 2017 13:31
Visual Studio Code Settings Sync Gist
{"lastUpload":"2017-12-13T13:31:42.174Z","extensionVersion":"v2.8.7"}

Files

The basic structure of a React+Flux application (see other examples)

 - /src/actions/AppActions.js     - Action creators (Flux)
 - /src/components/Application.js - The top-level React component
 - /src/constants/ActionTypes.js  - Action types (Flux)
 - /src/core/Dispatcher.js        - Dispatcher (Flux)
 - /src/stores/AppStore.js        - The main store (Flux)
@chrisjordanme
chrisjordanme / gist:2f2020a0b3d65ddac0c9
Created January 8, 2015 17:30
Angular Directive to Bind Event handler to transcluded DOM and then $broadcast events
angular.module('myApp')
.directive('myAppTrigger', function () {
return {
restrict: 'C',
transclude: true,
replace: true,
template: '<div ng-transclude></div>',
link: function (scope, el, attrs) {
el.on('click', function () {
scope.$broadcast(attrs.eventType || 'activated');
@chrisjordanme
chrisjordanme / gist:3c04100ca264506ef8f4
Last active August 29, 2015 14:10
Namespacing, yo.
'use strict';
var myNameSpace = (function (myNameSpace) {
myNameSpace = {};
return myNameSpace;
})(myNameSpace || {});
@chrisjordanme
chrisjordanme / gist:59e7cb13ed21e3ff2b91
Created November 3, 2014 19:25
Angular Resize Directive. Now with stagnation!
angular.module('your-module-name', [])
.directive('onResize', ['$window', function ($window) {
return {
link: function (scope, el, attrs) {
var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
@chrisjordanme
chrisjordanme / angular-resize.js
Created January 28, 2014 14:42
Angular Directive for Window Resize Event
angular.module('your-module-name', [])
.directive('onResize', ['$window', function ($window) {
return {
link: function (scope, el, attrs) {
var initialWidth = $window.innerWidth,
smallClass = attrs.resizeClass || 'yourDefault',
smallAttr = attrs.resizeAttr || 'yourDefault',
smallWidth = attrs.resizeWidth || 1024;
var setSmall = function () {
@chrisjordanme
chrisjordanme / bash
Last active October 26, 2016 20:05
My .bash_profile These configurations may or may not be useful for you. Customize to your needs...
# $PATH exports
# Android SDK to $PATH
export PATH=/usr/local/bin:/Users/chrisjordan/Documents/dev-resources/git-tf:/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home:~/Documents/dev-resources/adt-bundle-mac-x86_64-20140702/sdk/platform-tools:~/Documents/dev-resources/adt-bundle-mac-x86_64-20140702/sdk/tools:$PATH
export JAVA_HOME=$(/usr/libexec/java_home) #Added for Apache Maven installation
# Change this to your mac username
USER=chrisjordan
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
var gulp = require('gulp');
var gutil = require('gulp-util');
var express = require('express');
var path = require('path');
var tinylr = require('tiny-lr');
var createServers = function(port, lrport) {
var lr = tinylr();
lr.listen(lrport, function() {
gutil.log('LR Listening on', lrport);