Skip to content

Instantly share code, notes, and snippets.

View tpitre's full-sized avatar
💭
🍕

TJ Pitre tpitre

💭
🍕
View GitHub Profile
@tpitre
tpitre / .gitignore_global
Created November 14, 2013 23:04
Add this to your home directory to ignore commonly ignored files.
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@tpitre
tpitre / sass.js
Created November 17, 2014 19:57
Grunt: SASS Setup
module.exports = {
options: {
outputStyle: 'compressed',
imagePath: "../../<%= paths.dest.images %>",
sourceMap: false,
includePaths: require('node-bourbon').includePaths,
includePaths: require('node-neat').includePaths
},
dist: {
files: {
@tpitre
tpitre / package.js
Last active August 29, 2015 14:09
Grunt: Package Setup
{
"name": "project_name",
"description": "project_name project files",
"version": "1.0.0",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-bower-requirejs": "~0.11.0",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-copy": "~0.5.0",
"grunt-contrib-uglify": "~0.4.0",
@tpitre
tpitre / settings.php
Created November 18, 2014 18:56
Drupal: settings.php
<?php
/**
* The bulk of default.settings.php has been moved to
* sites/all/settings.common.php.
*/
/**
* Uncomment this to use Redis caching with default settings.
*/
@tpitre
tpitre / restful-docs.md
Last active August 29, 2015 14:09
Drupal: Restful Docs

Build Status

RESTful best practices for Drupal

This module achieves a practical RESTful for Drupal following best practices.

Concept

The following also describes the difference between other modules such as RestWs and Services Entity.

  • Restful module requires explicitly declaring the exposed API. When enabling the
@tpitre
tpitre / simple-parallax.js
Last active June 1, 2016 21:23
Simple Parallax Effect
// Is it a touch device? (requires Modernizr)
var isTouch = (Modernizr.touch) ? true : false;
// Background image parallax.
var parallax = function($b) {
if (!isTouch) {
var scrolled = $(window).scrollTop();
$b.css('background-position', 'center ' + -(scrolled * 0.5) + 'px');
}
}
@tpitre
tpitre / gulpfile.js
Created January 12, 2018 17:40
Gulp task for complex zipping of files
/**
* zipSetType():
* Searches all subdirectories of /output for specified file extensions and
* layout format then zips them up and drops the zip in its current directory.
*
* @param {string} extension [SVG, PNG, or PDF]
* @param {string} format [standard, centered, or text]
* @return {file} [returns zip files for specified parameters]
*/
function zipSetType(extension, format) {
@tpitre
tpitre / webpack.config.js
Created June 13, 2018 16:18
Simple Vue Webpack Config
// webpack.config.js
const path = require('path');
const {VueLoaderPlugin} = require('vue-loader');
module.exports = {
entry: {
bundle: './app/src/index.js'
},
output: {
@tpitre
tpitre / reserve-tracking.js
Created October 4, 2018 19:04
Dynamically add pixel once "Reserve Now" button is clicked
// These events fire for all "Reserve Now" buttons on both Delmonico Steakhouse and Emeril's New Orleans Fish House sections.
// ENOFH tracking script for reserve buttons.
$('.page-node-470 .btn__reserve').each(function() {
$(this).click(function(e) {
// DOM: Create the script element
var jsElm = document.createElement("script");
// set the type attribute
jsElm.type = "application/javascript";
// make the script element load a Simpli.fi one-off tag
@tpitre
tpitre / smartling-learning-center-sidebar-blockquote
Last active December 19, 2018 18:30
Smartling Right Rail Blockquote
<aside class="embedly-card">
<blockquote>
<p>BLOCKQUOTE TEXT GOES HERE</p>
<p>
<strong>BYLINE GOES HERE</strong>
<br />
BYLINE TITLE GOES HERE
</p>
<img src="/PATH/TO/LOGO/ASSET/GOES/HERE" alt="LOGO NAME" />
</blockquote>