Skip to content

Instantly share code, notes, and snippets.

@erikreagan
erikreagan / _details.md
Last active Aug 29, 2015
Sample Gulp.js file
View _details.md

Objectives

We're building a singular .html file that contains all css and javascript within it. No external dependencies. But we want to work on our css as sass and write our js in separate files. Additionally, this single .html file serves as a large documentation document with lots of code samples. As a result we've broken each code sampel out into a src/fieldTypes/ directory. So our task process is:

  1. Compile .sass files into single .css file with minification
  2. Error check .js files while ignoreing some Twig tags
  3. Concatenate multiple js files into a single file
  4. Concatenate all src/fieldTypes/*.html files into a single file
  5. Strip comment blocks from the resulting fieldTypes include file
  6. Include files in the core .html files (one for dev previews and one for distribution/download)
View pi.disable_profiler.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Disable Profiler
*
* @package Disable Profiler
* @author Focus Lab, LLC <dev@focuslabllc.com>
* @copyright Copyright (c) 2012 Focus Lab, LLC
* @license MIT http://opensource.org/licenses/mit-license.php
*/
@erikreagan
erikreagan / mac-apps.md
Created Aug 4, 2012
Mac developer must-haves
View mac-apps.md

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

View constants.php
<?php
// get constants defined by the application
// All constants available
$constants = get_defined_constants(TRUE);
// just constants from the app in question
$app_constants = $constants['user'];
echo '<pre>';
View st2-thoughts.md

While checking out Sublime Text 2 here are some things I miss from TextMate:

  • Command + C color palette in CSS files
  • Show invisibles (not quite the same as tab indentions)
  • In-app preview options for syntaxes like Textile, Markdown & HTML

Things I'm loving:

  • Command Palette
@erikreagan
erikreagan / config.local.php
Created Aug 8, 2011
Sample config.local.php file from the Focus Lab, LLC Master Config setup for EE2
View config.local.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Local config overrides & db credentials
*
* Our database credentials and any environment-specific overrides
* This file should be specific to each developer and not tracked in Git
*
* @package Focus Lab Master Config
* @version 1.1
@erikreagan
erikreagan / commit.textile
Created Aug 3, 2011
recent commit message
View commit.textile

Added initial add-ons to repo

Assets
Calendar
CP Analytics
Deployment Hooks
ED ImageResizer
Json
Low Alphabet
Low Reorder

@erikreagan
erikreagan / pi.recent_tweet.php
Created Jul 28, 2011
Tiny EE1 Plugin to grab the most recent tweet from a given account
View pi.recent_tweet.php
<?php
/**
* Recent Tweet
*
* Grab the single most recent tweet based on Twitter's v1 API
* http://api.twitter.com/1/users/lookup.json
* Auto-links URLs with t.co link but displays original URL
*
* @package RecentTweet
@erikreagan
erikreagan / ext.entry_global_vars_ext.php
Created Jun 29, 2011
Parse global vars within entries in EE 1.x. (Probably could be cleaner, but it'll work for today.)
View ext.entry_global_vars_ext.php
<?php if ( ! defined('EXT')) exit('Invalid file request');
// ini_set('error_reporting',E_ALL);
/**
* Entry Global Vars
*
* Parse global variables used in your weblog entries.
*
* @package EntryGlobalVars
* @version 1.0.0
@erikreagan
erikreagan / log_item.php
Created Jun 18, 2011
EE Template Debugger log_item function tweak (based on an article by Greg Aker)
View log_item.php
<?php>
function log_item($str)
{
if ($this->debugging !== TRUE)
{
return;
}
if ($this->depth > 0)
You can’t perform that action at this time.