Moved and maintaining this here: http://patricksimpson.me/posts/intro-to-polymer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MY_KEY = Symbol(); | |
let obj = { | |
[MY_KEY]: 123 | |
}; | |
"use strict"; | |
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# npm install and save dev | |
function ni() { | |
npm install --save-dev "$@" | |
} | |
# npm install grunt package, and save dev. | |
function gi() { | |
npm install --save-dev grunt-"$@" | |
} | |
# npm install grunt contrib package, and save dev. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin patrick@heysparkbox.com | |
DocumentRoot "" | |
ServerName server.dev | |
<Directory ""> | |
Options Indexes MultiViews FollowSymLinks | |
AllowOverride All | |
Order allow,deny | |
Allow from all | |
DirectoryIndex index.html index.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* NEW DYNAMIC FUNCTION */ | |
define( 'OAM_DYNAMIC_YOUR_FUNCTION', 'CACHE_OAM_YOUR_TAG'); | |
function OAM_your_function_filter( &$cachedata = 0) { | |
if (defined('OAM_DYNAMIC_YOUR_FUNCTION_TEXT')) | |
return str_replace( OAM_DYNAMIC_YOUR_FUNCTION, OAM_DYNAMIC_YOUR_FUNCTION_TEXT, $cachedata); | |
$text = OAM_your_function_filter_output(); | |
if ( $cachedata === 0 ) | |
define('OAM_DYNAMIC_YOUR_FUNCTION_TEXT', $text); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (OAM_isCaching('OAM_your_function_filter')){ | |
OAM_your_function_filter(); | |
?> | |
CACHE_OAM_YOUR_TAG | |
<?php } else { | |
echo OAM_your_function_filter_output(); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ifmodule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access plus 1 second" | |
ExpiresByType text/html "access plus 7200 seconds" | |
ExpiresByType image/gif "access plus 518400 seconds" | |
ExpiresByType image/jpeg "access plus 518400 seconds" | |
ExpiresByType image/png "access plus 518400 seconds" | |
ExpiresByType text/css "access plus 1 month" | |
ExpiresByType text/javascript "access plus 216000 | |
seconds" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Rolls back the latest release" | |
task :rollback => :environment do | |
queue! %[echo "-----> Rolling back to previous release for instance: #{domain}"] | |
# Delete existing sym link and create a new symlink pointing to the previous release | |
queue %[echo -n "-----> Creating new symlink from the previous release: "] | |
queue "echo `cat #{deploy_to}/last_version` | ruby -e 'p gets.to_i-1'" | |
queue! "echo `cat #{deploy_to}/last_version` | ruby -e 'p gets.to_i-1' | xargs -I active ln -nfs '#{deploy_to}/releases/active' '#{deploy_to}/current'" | |
# Remove latest release folder (active release) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this in your terminal -- this will fix your harvest clock back to HH:MM | |
# After you run the command, restart harvest. | |
# Buy sizzle a coffee. | |
defaults write com.getharvest.harvestxapp TimeFormat hours_minutes | |
# or | |
defaults write ~/Library/Preferences/com.getharvest.harvestx.plist TimeFormat hours_minutes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ctrl + A Go to the beginning of the line you are currently typing on | |
Ctrl + E Go to the end of the line you are currently typing on | |
Ctrl + L Clears the Screen, similar to the clear command | |
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line. | |
Ctrl + H Same as backspace | |
Ctrl + R Let’s you search through previously used commands | |
Ctrl + C Kill whatever you are running | |
Ctrl + D Exit the current shell | |
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it. | |
Ctrl + W Delete the word before the cursor |
OlderNewer