Skip to content

Instantly share code, notes, and snippets.

@joshfinnie
joshfinnie / views.py
Created December 30, 2014 20:19
BreweryDB webhook example (Django)
import hashlib
from django.conf import settings
from django.core.exceptions import PermissionDenied
def webhook_receive(request):
"""
View used to receive webhooks from BreweryDB
"""
isValid = hashlib.sha1(settings.BREWERYDB_API_KEY + request.GET['nonce']) == request.GET['key']
@joshfinnie
joshfinnie / request.py
Created December 30, 2015 16:30
Which one is better??
try:
response = requests.post(
"<URL>",
auth=(
os.environ.get('<USERNAME>'),
os.environ.get('<PASSWORD>')
),
data=json.dumps(payload))
except Exception as e:
# do something

Const for Hello World of ES2015 in Node Core

Example 1

const foo = "foo";
foo = "bar"; // should not assign
console.log(foo);
(function(){ console.log("hacked!"); }());
@joshfinnie
joshfinnie / mastodon_python.csv
Last active January 25, 2023 00:45
A CSV of Python people on Mastodon for easy import (major work done here: https://gist.github.com/samuelcolvin/1743d8919acb465c1fbbcea2c3cdaf3e)
Account address Show boosts Notify on new posts Languages
@[email protected] true false
@[email protected] true false
@[email protected] true false
@[email protected] true false
@[email protected] true false
@[email protected] true false
@[email protected] true false
@[email protected] true false
@[email protected] true false