Skip to content

Instantly share code, notes, and snippets.

@adamthebig
adamthebig / templating.md
Created September 13, 2016 02:14 — forked from brandonkelly/templating.md
Templating in EE vs. Craft

Templating in EE vs. Craft

Lots of people have asked, so here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft.

Table of Contents

  1. Comments
  2. Conditionals
  3. Loops
@adamthebig
adamthebig / .bash_profile
Last active August 7, 2018 21:01 — forked from stephenll/.bash_profile
.bash_profile file on Mac OS X
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
@adamthebig
adamthebig / gist:f66f750f90e482628649
Created February 28, 2016 20:05 — forked from ZellSnippets/gist:8857254
PHP: DateTime common
<?
// Get Year
$today = new DateTime();
$year = $today->format('Y');
// Set Date
$date = new DateTime();
$date->setDate(2014, 12, 31);
@adamthebig
adamthebig / DNS prefetching
Created November 17, 2015 07:24
Common Prefetch Links
<!-- Amazon S3 -->
<link rel="dns-prefetch" href="//s3.amazonaws.com">
<!-- Google CDN -->
<link rel="dns-prefetch" href="//ajax.googleapis.com">
<!-- Microsoft CDN -->
<link rel="dns-prefetch" href="//ajax.microsoft.com">
<link rel="dns-prefetch" href="//ajax.aspnetcdn.com">
#!/usr/bin/env python
'''
Harvest (www.getharvest.com) does not support setting monthly budgets for projects.
The recommended workaround is creating a new project every month. This script is
supposed to run on the first of every month and uses the Harvest API in order to
archive last month's projects and create new ones for the current month. Members
and tasks are automatically copied over to the new project.
Projects with monthly budgets need to fulfill two requirements:
1. They need to have a budget set
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@adamthebig
adamthebig / readme.md
Last active August 29, 2015 14:14 — forked from coolaj86/how-to-publish-to-npm.md
Publishing an NPM module

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@adamthebig
adamthebig / using-git.md
Last active August 29, 2015 14:13 — forked from hofmannsven/README.md
Using Git