Skip to content

Instantly share code, notes, and snippets.

@erikreagan
erikreagan / _details.md
Last active May 31, 2022 14:24
Sample Gulp.js file

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)
<?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 August 4, 2012 19:18
Mac developer must-haves

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

<?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>';

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 August 8, 2011 12:18
Sample config.local.php file from the Focus Lab, LLC Master Config setup for EE2
<?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 August 3, 2011 13:39
recent commit message

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 July 28, 2011 17:07
Tiny EE1 Plugin to grab the most recent tweet from a given account
<?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 June 29, 2011 19:59
Parse global vars within entries in EE 1.x. (Probably could be cleaner, but it'll work for today.)
<?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 June 18, 2011 13:48
EE Template Debugger log_item function tweak (based on an article by Greg Aker)
<?php>
function log_item($str)
{
if ($this->debugging !== TRUE)
{
return;
}
if ($this->depth > 0)