Skip to content

Instantly share code, notes, and snippets.

View philpalmieri's full-sized avatar
🏠
Working from home

Phil Palmieri philpalmieri

🏠
Working from home
View GitHub Profile
@philpalmieri
philpalmieri / open-links-in-new-tab-with-analytics.js
Last active April 6, 2018 16:36 — forked from hutch78/open-links-in-new-tab-with-analytics.js
PCOMM - Open links and files in new tab, fire analytics event
@philpalmieri
philpalmieri / currencies.json
Created February 1, 2018 21:49 — forked from mlvea/currencies.json
Common currencies as an array
[
{
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@philpalmieri
philpalmieri / testMocks.js
Created January 25, 2018 22:20 — forked from quitschibo/testMocks.js
How to mock jQuery calls with Jasmine. Just some examples ;)
describe('Mock jQuery calls with Jasmine', function() {
it('how to mock $("test").show()', function() {
// mock the call
spyOn($.fn, 'show').andCallFake(function() {
return true;
});
// now we can call the mock
result = $("test").show();
@philpalmieri
philpalmieri / gform_s3_uploader.php
Created January 10, 2018 21:17 — forked from antonmaju/gform_s3_uploader.php
Gravity form filter to handle file upload integration with WP Offload S3 Lite plugin. Adapted from https://wordpress.org/support/topic/support-for-gravity-forms-uploads.
<?php
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
require_once WP_CONTENT_DIR.'/plugins/amazon-web-services/vendor/aws/aws-autoloader.php';
use \Aws\S3\S3Client;
add_filter('gform_upload_path', 'gform_change_upload_path', 10, 2);
add_action('gform_after_submission', 'gform_submit_to_s3', 10, 2);
//change gravity form upload path to point to S3
@philpalmieri
philpalmieri / git
Created October 19, 2015 21:17
git tips
git diff : compare current with staged (or with last commit if no staged one)
git diff —staged : compare staged with last commit
git diff <master>…<topicbr> : show diff introduced by topicbr comparing to master (base commit in master)
git diff <sha-1> : show diff betwheen latest commit of current branch and other commit (sha-1)
git log -n : view last n commits
git log -n -p : last n commits with summary of changes (diff)
git log -n —graph : graphical view branch history
git log —pretty=oneline : each commit at one line
git log <br1> —not <br2> : list commits which are in br1 but not in br2