Skip to content

Instantly share code, notes, and snippets.

@adamthebig
adamthebig / git-commit-log.sh
Created March 17, 2016 21:21
Export commits from a git repo into a pretty spreadsheet (CSV)
git log --pretty=format:'"%h","%an","%aD","%s",' --shortstat --no-merges | paste - - - > log.csv
#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/
@adamthebig
adamthebig / fix-sudoer-issue.txt
Created May 9, 2016 23:25
Fix sudo: unable to stat /etc/sudoers: Permission denied sudo: no valid sudoers sources found, quitting
Reboot into single user mode (hold Option S while booting until it switches to text mode)
At the single user prompt, type: /sbin/fsck -fy
This checks the filesystem integrity
Then type: /sbin/mount -wu /
This mounts the root filesystem as read/writable.
@adamthebig
adamthebig / craft.request.twig
Created February 13, 2016 18:54
Craft request cheat sheet
{# Properties #}
{{ craft.request.firstSegment }}
{{ craft.request.isAjax }}
{{ craft.request.isLivePreview }}
{{ craft.request.isSecure }}
{{ craft.request.lastSegment }}
{{ craft.request.pageNum }}
{{ craft.request.path }}
{{ craft.request.segments }}
{{ craft.request.serverName }}
@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">
@adamthebig
adamthebig / .ee-bootstrap-pagination
Last active October 9, 2019 06:48
ExpressionEngine Pagination with Bootstrap 3
{paginate}
{pagination_links}
<ul class="pagination">
{first_page}
<li><a href="{pagination_url}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
{/first_page}
{page}
<li{if current_page} class="active"{/if}><a href="{pagination_url}">{pagination_page_number}</a></li>
{/page}
{last_page}
@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 / todays-date.gs
Last active November 1, 2016 17:25
Insert today's date into a Google doc, using a custom macro (Utilities/Insert Today's Date)
/**
* The onOpen function runs automatically when the Google Docs document is
* opened. Use it to add custom menus to Google Docs that allow the user to run
* custom scripts. For more information, please consult the following two
* resources.
*
* Extending Google Docs developer guide:
* https://developers.google.com/apps-script/guides/docs
*
* Document service reference documentation:
@adamthebig
adamthebig / tween-types.txt
Last active October 13, 2016 04:16
Tween names available for use in the scroll-to package - http://picdor.co/2dTA8DE
in-quad
out-quad
in-out-quad
in-cube
out-cube
in-out-cube
in-quart
out-quart
in-out-quart
in-quint