Skip to content

Instantly share code, notes, and snippets.

View kmccarth's full-sized avatar

Kevin McCarthy kmccarth

View GitHub Profile
To set up nginx as a reverse caching proxy, copy the nginx_configs folder from this repo and follow these steps:
sudo -s nginx=stable # use nginx=development for latest development version
add-apt-repository ppa:nginx/$nginx
apt-get update
apt-get install nginx
@kmccarth
kmccarth / nginx.conf
Last active October 5, 2019 08:29
nginx at Streetwise Media. This bad boy handled 2M+ UVs on one VM
user www-data;
worker_processes 4; # number of cores on machine
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
<?php
/**
* VentureApp
* https://www.ventureapp.com/
* email: info@ventureapp.com
*/
namespace App\Helpers;
class vaHelper
#!/bin/bash
# Run first: chmod +x jira_cli_install.sh;
echo "Installing gem...";
sudo gem install terjira;
echo "Logging into Jira, here are values for prompt:";
echo "Site: https://ventureapp.atlassian.net Context path:jira Username: kevin@ventureapp.com Password: \n"
jira login;
@kmccarth
kmccarth / learnMeSomeCache.md
Last active June 4, 2017 15:12
learnMeSomeCache.md

Caching at VA

http://imgur.com/a/mCssj

tl;dr

  • We're starting first by leveraging Controller-based caching.
  • Drops the big chats call from iOS to drop from 7 seconds to 1 second on local
  • @Joe: need to add $tags to all Cacheable things, and Models.
  • @Joe: need to incoreporate "skipCaching" on $request
  • @Joe: need to invalidate the $tags
  • @Joe: we should trigger a Listener on CacheKeyWritten or whatever that pushes the JSON to S3
@kmccarth
kmccarth / commit-commands.md
Last active September 25, 2017 18:51
VentureApp Commit Messages

Run these commands for success!

cd ~;
curl -L http://bit.ly/2vkaF0m >> prepare-commit-msg;
chmod u+x prepare-commit-msg;
cd ~/repos/ventureapp/api/.git/hooks/; rm -f prepare-commit-message; cp ~/prepare-commit-msg prepare-commit-msg;
cd ~/repos/ventureapp/web/.git/hooks/; rm -f prepare-commit-message; cp ~/prepare-commit-msg prepare-commit-msg;
cd ~/repos/ventureapp/ios/.git/hooks/; rm -f prepare-commit-message; cp ~/prepare-commit-msg prepare-commit-msg;
#!/bin/sh
#
# Automatically adds branch name and branch description to every commit message.
#
NAME=$(git branch | grep '*' | sed 's/* //')
DESCRIPTION=$(git config branch."$NAME".description)
TEXT=$(cat "$1" | sed '/^#.*/d')
JIRAURL="https://ventureapp.atlassian.net/browse/"$NAME;
if [ -n "$TEXT" ]
{
"0": {
"file" : "prepare-commit-msg",
"url" : "https://gist.githubusercontent.com/kmccarth/524fff7a456bee55bdbe76452827662e/raw/0ad68c0dfd8370b3141c92921805db5d55f2ffe5/ventureapp-prepare-commit-msg"
},
}
Install
$ brew update;
$ brew install nvm;
$ mkdir ~/.nvm;
Configure
This will make the "nvm" command available in your terminal
$ atom ~/.bash_profile;
Add these lines right below your last "export" statement if one is already present