Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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
@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 / 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 / test-cards.html
Created October 6, 2015 21:19
Stripe test cards
<table>
<thead>
<tr><th>Number</th>
<th>Card type</th>
</tr></thead>
<tbody>
<tr><td class="number"><code>4242<span></span>4242<span></span>4242<span></span>4242</code></td><td>Visa</td></tr>
<tr><td class="number"><code>4012<span></span>8888<span></span>8888<span></span>1881</code></td><td>Visa</td></tr>
<tr><td class="number"><code>4000<span></span>0566<span></span>5566<span></span>5556</code></td><td>Visa (debit)</td></tr>
<tr><td class="number"><code>5555<span></span>5555<span></span>5555<span></span>4444</code></td><td>MasterCard</td></tr>