Skip to content

Instantly share code, notes, and snippets.

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',
<?php
class OAuthException extends Exception
{
// pass
}
class OAuthConsumer
{
public $key;
@hirobert
hirobert / flask_abort_example.py
Created January 13, 2016 20:38
flask abort as json
from flask import abort, make_response, jsonify
abort(make_response(jsonify(message="Message goes here"), 400))
@hirobert
hirobert / empty-rq-failed-queue.py
Created October 12, 2023 18:58
Fix Stuck Jobs in RQ Failed Queue
# If RQ thinks there are failed jobs
# but they do not exist in Redis
# and RQ-Dashboard cannot remove/requeue them
from redis import Redis
from rq import Queue
from rq.registry import FailedJobRegistry
from rq.exceptions import NoSuchJobError
redis_rq = Redis(host=REDIS_SERVER, port=6379, db=1)
@hirobert
hirobert / response-content-disposition-cloudfront.txt
Last active December 21, 2023 20:38
response-content-disposition and cloudfront
1) Log in to aws console.
2) Click cloudfront
3) Click behaviors
4) Select pattern and edit