This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name *.cogclient.com; | |
access_log /var/log/nginx/cogclient.access.log; | |
error_log /var/log/nginx/cogclient.error.log; | |
location / { | |
resolver 8.8.8.8; | |
set $bucket "happycog-static.s3-website-us-east-1.amazonaws.com"; | |
rewrite ^([^.]*[^/])$ $1/ permanent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repo=$(basename "$PWD") | |
branch=$(git symbolic-ref --short -q HEAD) | |
aws s3 cp public/ s3://happycog-static/$repo/$branch --recursive --acl=public-read | |
if [[ "$branch" = "master" ]]; then | |
url="http://$obj.cogclient.com" | |
else | |
url="http://$branch.$repo.cogclient.com" | |
fi | |
slackText="$repo: $branch branch was just deployed to $url" | |
curl -X POST --data-urlencode "payload={\"text\": \"$slackText\"}" https://hooks.slack.com/services/XXXXXXXXXX/XXXXXXXXXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
machine: | |
node: | |
version: 5.10.0 | |
dependencies: | |
override: | |
- npm install | |
- npm install -g grunt-cli | |
cache_directories: | |
- "node_modules" | |
test: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add your env variables | |
DATABASE_HOST='127.0.0.1' | |
DATABASE_USER='root' | |
DATABASE_PASS='root' | |
DATABASE_NAME='database_name' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
class HomeController extends Controller | |
{ | |
public function show() | |
{ | |
$dataJsonAsPhpArray = array( | |
“title” => “This is my title.”, | |
“subTitle” => “There are many like it, but this one is mine.”, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Extensions\Mustache; | |
use Mustache_Loader; | |
class PatternLoader implements Mustache_Loader | |
{ | |
private $baseDir; | |
private $patterns = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# API authentication | |
from social.apps.django_app.utils import strategy | |
from rest_framework.authtoken.models import Token | |
from rest_framework.views import APIView | |
from rest_framework import parsers | |
from rest_framework import renderers | |
from rest_framework.authentication import get_authorization_header | |
from rest_framework.response import Response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import httplib2 | |
from apiclient.discovery import build | |
from oauth2client.client import SignedJwtAssertionCredentials | |
# | |
PROJECT_ID = '############' | |
SERVICE_ACCOUNT_EMAIL = '############-##################@developer.gserviceaccount.com' | |
SCOPE = 'https://www.googleapis.com/auth/bigquery' | |
P12_CERT = 'PATH/TO/###########################-privatekey.p12' | |
# |