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 / 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
@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 / 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 / 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 / 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 / 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.
*
Error: /Users/andrewdelprete/Work/Code Testing/my-app/node_modules/react-scripts/config/eslint.js: Configuration for rule "array-callback-return" is invalid: Value "warn" is the wrong type.
Referenced from: /Users/andrewdelprete/Work/Code Testing/my-app/package.json
Error: /Users/andrewdelprete/Work/Code Testing/my-app/node_modules/react-scripts/config/eslint.js:
Configuration for rule "array-callback-return" is invalid:
Value "warn" is the wrong type.
@andrewdelprete
andrewdelprete / neckbeard-style-object.js
Last active September 13, 2016 03:50
NeckbeardJS - Pass an Object
// https://www.neckbeardjs.com/usage
import Neckbeard from 'neckbeard';
const nb = Neckbeard.create();
// Pass your own custom styles object to be injected
// into the DOM dynamically using Aphrodite.
// You can use Neckbeard styles to compose!
const styles = {
"text": {
// app/Http/Middleware/AssetUrls.js
// Middleware to load mix-manifest.json
// file Laravel Mix generates
class AssetUrls {
* handle (request, response, next) {
const View = use('View')
View.global('assetUrls', function () {
return require('../../../public/mix-manifest.json')
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'