Skip to content

Instantly share code, notes, and snippets.

View andrewdelprete's full-sized avatar
💭
I may be slow to respond.

Andrew Del Prete andrewdelprete

💭
I may be slow to respond.
View GitHub Profile
@andrewdelprete
andrewdelprete / gist:80a6faf4b974b33cb740
Created August 21, 2015 15:56
git - remove merged branches
alias goats="git branch --merged | grep -v \"\*\" | xargs -n 1 git branch -d"
@andrewdelprete
andrewdelprete / index.js
Last active August 29, 2015 14:19
Retrieve A/B e-mails from Mailchimp API sent-to.json
var request = require('request');
var fs = require('fs');
var apikey = null
var cid = null
var emailFinalArray = [];
var total = 0;
var start = 0;
var limit = 100;
@andrewdelprete
andrewdelprete / js-inheritance.md
Last active December 31, 2017 16:23
Learning to inherit with Javascript

Functional Inheritance

Basically a function in which you add additional functionality before returning it. Because the additional functionality is considered to be cloned from one function to another it doesn't matter if you inherit from a base / super function or some non-related function, it all works.

/**
 * friend(name)
 * Constructor Function - Must be instantiated to be used.
 */
var friend = function(name) { // Function Expression
    this.name = name,
@andrewdelprete
andrewdelprete / gist:cec48a87c04177b663d8
Created February 5, 2015 03:11
Angular UI-Router Multiple Names Views
/**
* DEMO: http://plnkr.co/edit/TowGcXENTVDteaKs77Ah?p=preview
* OFFICIAL DOCS: https://github.com/angular-ui/ui-router/wiki/Multiple-Named-Views
*
* I've grown fond of ui-router and use it in pretty much every application I build now a days.
* However, I love the simplicity of ReactJS and would love to start building apps with it.
* I need the ability to have multiple views running on the same page. ReactJS may take care of this already
* since each component is self contained with it's own methods / handlers, kind of like how AngularJS' Directives
* have their own controllers that can pull in data from the parent ctrl and render the directive accordingly.
*
@andrewdelprete
andrewdelprete / laracon-2014-notes.md
Last active November 19, 2018 17:19
My notes from Laracon 2014

###Jeffrey Way (1) - Bootcamp

Jeffrey went through about 12 subjects one right after the other and gave tips along the way.

  1. Mail Drivers for mail notifications.
1. With Laravel 4.2 it’s easier to use APIs like Mailgun and Mandrill for e-mail notifications. This avoids using SMTP which is really cool.
  1. File Generators for generating schema migrations.
@andrewdelprete
andrewdelprete / dateLocalize
Created April 23, 2014 23:07
AngularJS - dateLocalize Filter localizes UTC time
//
// Example: {{ request.updated_at | dateLocalize | date:'short' }}
angular.module('MyApp', [])
.filter('dateLocalize', function () {
return function (utcDate) {
var dt = new Date(utcDate + 'Z').getTime();
return dt;
}
});
@andrewdelprete
andrewdelprete / app.js
Last active August 29, 2015 13:58 — forked from mariojunior/gist:6175849
Angular Cookie Fix - Standard CORS requests do not send or set any cookies by default : withCredentials
//On config definition...
angular.module("moduleName").config(
function ($routeProvider, $httpProvider) {
// ALLOWS CORS
// Standard CORS requests do not send or set any cookies by default. In order to include cookies as
// part of the request, you need withCredentials property to true.
// http://www.html5rocks.com/en/tutorials/cors/
// HERE THE IMPORTANT MAGIC LINE!
@andrewdelprete
andrewdelprete / prayerApp-api.conf
Created April 3, 2014 22:31
Apache Conf - 1 Site to 1 Directory
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName api.192.168.33.10.xip.io
DocumentRoot /vagrant/PrayerApp/laravel/public
<Directory /vagrant/PrayerApp/laravel/public>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted