Skip to content

Instantly share code, notes, and snippets.

@hirobert
hirobert / .env
Created Jan 10, 2019 — forked from schavery/.env
New Relic RQ setup
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',
@hirobert
hirobert / OAuth.php
Last active Dec 5, 2018
Noun Project API - PHP Example
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
}
@hirobert
hirobert / response-content-disposition-cloudfront.txt
Last active Feb 21, 2019
response-content-disposition and cloudfront
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
You can’t perform that action at this time.