Skip to content

Instantly share code, notes, and snippets.

View MichaelMauderer's full-sized avatar

Michael Mauderer MichaelMauderer

View GitHub Profile
@cordery
cordery / heroku_test_runner.py
Created April 24, 2017 20:48
Heroku CI compatible DiscoverRunner class for Django 1.10+ that does not require createdb or dropdb permissions.
import os
from django.test.runner import DiscoverRunner
"""
WARNING: WHEN USED INCORRECTLY THIS TEST RUNNER WILL DROP ALL TABLES IN YOUR PRODUCTION
DATABASE!!!
Heroku does not give users createdb/dropdb permissions, therefore Heroku CI cannot run tests for django.
In order to fix this, use this test runner instead which attempts to minimally override the
@attacus
attacus / riot-matrix-workshop.md
Last active March 13, 2024 00:16
Create your own encrypted chat server with Riot and Matrix

This guide is unmaintained and was created for a specific workshop in 2017. It remains as a legacy reference. Use at your own risk.

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

@joepie91
joepie91 / vpn.md
Last active July 20, 2024 13:53
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@gtallen1187
gtallen1187 / slope_vs_starting.md
Created November 2, 2015 00:02
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@tianchu
tianchu / django_auth.js
Last active June 1, 2023 21:44
How to authenticate Django users in node.js
/*
* Authenticate Django users in node.js.
*
* Django is great for many projects, while node.js does some fantastic
* jobs that Django couldn't. For example, you may have a Django app
* managing your user accounts and another real-time service or application
* running on Node, then you probably will need to read Django user session
* to authenticate users in the Node project.
*
* This gist is not production ready yet, but it demonstrates how could it
@timmyomahony
timmyomahony / extra_cms_tags.py
Last active March 5, 2019 12:33
A template tag for `django-cms` that allows a placeholder to be rendered and placed in a context variable so that the placeholder can be conditionally loaded. This code was originally submitted on the `django-cms` Google Group by Benoit Domingue: https://groups.google.com/forum/#!topic/django-cms/WDUjIpSc23c/discussion
from classytags.arguments import Argument, MultiValueArgument
from classytags.values import StringValue
from cms.templatetags.cms_tags import Placeholder, PlaceholderOptions
from cms.models.placeholdermodel import Placeholder as PlaceholderModel
from django import template
from django.utils.safestring import mark_safe
register = template.Library()
@enjalot
enjalot / index.html
Created November 18, 2011 23:56
d3 behavior.drag example
<!DOCTYPE html>
<html>
<head>
<title>Chernoff Smileys</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.5.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.5.0"></script>
<style type="text/css">
</style>
</head>