View .env
NEW_RELIC_LICENSE_KEY=6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5 | |
NEW_RELIC_LOG=stdout | |
NEW_RELIC_APP_NAME=proj--staging |
View NounApiClient.swift
// taken from https://github.com/erndev/NounSample/blob/master/NounSample/NounApiClient.swift | |
// | |
// NounApiClient.swift | |
// NounSample | |
// | |
// Created by ERNESTO GARCIA CARRIL on 9/10/15. | |
// Copyright © 2015 ernesto. All rights reserved. | |
// | |
import AppKit |
View flask_abort_example.py
from flask import abort, make_response, jsonify | |
abort(make_response(jsonify(message="Message goes here"), 400)) |
View NounProjectAPI.cs
//taken from https://github.com/KaneQc/Noun-Project-API/blob/master/NounProjectAPI.cs | |
using RestSharp; | |
using RestSharp.Authenticators; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Request |
View noun-project.js
var OAuth = require('oauth') | |
// `npm install oauth` to satisfy | |
// website: https://github.com/ciaranj/node-oauth | |
var KEY = "<INSERT KEY HERE>" | |
var SECRET = "<INSERT SECRET HERE>" | |
var oauth = new OAuth.OAuth( | |
'http://api.thenounproject.com', | |
'http://api.thenounproject.com', |
View OAuth.php
<?php | |
// mirror of: http://oauth.googlecode.com/svn/code/php/OAuth.php | |
// vim: foldmethod=marker | |
/* Generic exception class | |
*/ | |
class OAuthException extends Exception { | |
// pass | |
} |
View response-content-disposition-cloudfront.txt
1) Log in to aws console. | |
2) Click cloudfront | |
3) Click behaviors | |
4) Select pattern and edit |
View file-download.py
from flask import Flask, send_from_directory | |
import os | |
app = Flask(__name__) | |
app.debug = True | |
_file_directory = 'files/' | |
@app.route('/') | |
def directory(): |
View Flask-CORS.py
from flask import make_response | |
def cors_response(data): | |
response = make_response(data) | |
response.headers['Access-Control-Allow-Origin'] = '*' | |
return response |