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 / gist:56a814510f4021f0b87e0faacddaf849
Created January 25, 2018 13:37
Node Fetch Test w/Chai and nock
import * as mocha from 'mocha';
import * as chai from 'chai';
import chaiHttp = require('chai-http');
import app from '../src/App';
let nock = require('nock');
chai.use(chaiHttp);
const expect = chai.expect;
@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
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import {environment} from "../../environments/environment";
/** Encryption Stuff **/
var CryptoJS = require("crypto-js");
var hmacsha1 = require('hmacsha1');
@philpalmieri
philpalmieri / jquery
Last active January 25, 2018 13:42
jQuery Plugin Skeleton
// JQuery
(function(root, $) {
/**
* Doc Block
*/
function ClassName() {
// Methods and variables
}
// register namespace
alias glog="git log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%ai) %C(bold blue)<%an>%Creset'"
@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
@philpalmieri
philpalmieri / new box
Created August 29, 2013 15:22
Notes for a new ubuntu box
//Install
apt-get install apache2
apt-get install php5 libapache2-mod-php5
apt-get install php5-imap
apt-get install libssh2-php
apt-get install mysql-server