Skip to content

Instantly share code, notes, and snippets.

View jdunck's full-sized avatar

Jeremy Dunck jdunck

View GitHub Profile
In nginx.conf, in the Logging Settings section:
log_format replay '[$time_local] $server_name $status $content_type $request_method XX_HOST_XX$request_uri Authorization:"$http_authorization" $request_body_file';
In specific server/location's config:
client_body_in_file_only on;
access_log /var/log/nginx/whatever-replay.log replay;
@jdunck
jdunck / README.md
Last active August 17, 2018 20:29
Python preamble ordering

It's been hard for me to remember what the required relative order of python preambles (that is, encoding markers, future imports, and module docstrings) should be.

This is an empirical approach, showing that the proper order is:

# -*- coding: utf8 -*-

"""døcst®îñg"""

from __future__ import unicode_literals

Re: http://dancerscode.com/blog/why-the-open-code-of-conduct-isnt-for-me/

They, like all forms of political correctness, center around people being offended, sometimes about things like technical ability which can and should be spoken about frankly in any open source project.

Right, so there’s behaviour such as not accepting a PR and saying it didn’t meet review, or there’s telling a newbie that they shouldn’t write code because they’re a woman/trans/person of colour/etc. There’s closing a PR and there’s closing a PR with a joke containing something about a kitchen and a sandwich that we’ve all heard hundreds of times prior attached to it.

>Judging and punishing the behavior of those who speak based on the sensibilities of those who listen is a standard which is inherently unfair to the speaker. This precipitates an environment where the exchange of ideas between people who differ is impossible if either of them thinks that the other may find the topic offensive. This carries with it the danger of stiflin

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@jdunck
jdunck / Example output
Last active August 29, 2015 14:02
Generate south depends_on based on the current django project tree
depends_on = (
('about', '0004_fake_user_fk'),
('accounts', '0029_auto__del_registration'),
('activity_feed', '0002_fake_user_fk'),
('analytics', '0006_add_labels'),
('art', '0036_auto__chg_field_packpurchase_royalty_millicents_per_credit__chg_field_'),
('bots', '0002_fake_user_fk'),
('comments', '0002_fake_user_fk'),
('core', '0012_auto__del_field_creatorprofile_points_balance__add_field_creatorprofil'),
('creator', '0002_fake_user_fk'),
@veorq
veorq / simple.py
Last active December 20, 2015 14:29
Simple password hash
"""
This is an EXPERIMENTAL password hash with time and memory parameters,
such that the time parameter does not affect the memory required (but
does affect the number of memory accesses).
This was quickly designed, with no real test, so it's probably a silly
design and the code may be broken. Therefore, please:
- Do not use it to hash real passwords!
- Attack it! (circumvent the time/memory requirements, find biases...)
@wilkie
wilkie / diversity_links.md
Last active June 15, 2021 16:49
Some links devoted to diversity discussion.
@mbostock
mbostock / .block
Last active September 17, 2018 12:46
Threshold Key
license: gpl-3.0
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@dgouldin
dgouldin / gist:3696240
Created September 11, 2012 05:45
Candidates running against supporters of SOPA
https://www.votizen.com/matt-helt-for-us-house/
https://www.votizen.com/phil-jennerjahn-for-us-house-1/
https://www.votizen.com/candace-duval-for-us-house/
https://www.votizen.com/brad-morris-for-us-house/
https://www.votizen.com/robert-estes-for-us-house/
https://www.votizen.com/henry-ross-for-us-house/
https://www.votizen.com/jim-bourland-for-us-house/
https://www.votizen.com/danny-bedwell-for-us-house/
https://www.votizen.com/chris-potts-for-us-house/
https://www.votizen.com/philip-scollo-for-us-house/