Skip to content

Instantly share code, notes, and snippets.

@Galarius
Galarius / django_test_api.py
Last active August 29, 2015 14:10
Test api with auth-key and user
# Every request to api requires an auth-key in header in this example.
# Example of how to perform api testing with such authentication.
# django 1.7
from django.apps import apps
from django.conf import settings
from django.test.client import RequestFactory
from api.user.views import UserKeyView
@Christophe31
Christophe31 / gist:859222a9d83e74d3bb0a
Last active August 29, 2015 14:05 — forked from ramusus/gist:4343464
damn, it was app specific, how to find current field name?
"""
# Christophe31
Shamlessly taken from: https://gist.github.com/ramusus/4343464
adapted to dj1.7 and allow Inline class as field argument.
# Ramsus
adminreverse from here http://djangosnippets.org/snippets/2032/
changed for working with ForeignKeys
@padde
padde / openvpn.md
Last active April 30, 2018 17:11
OpenVPN on Ubuntu 12.10 at DigitalOcean

OpenVPN on Ubuntu 12.10 at DigitalOcean

Install OpenVPN

sudo apt-get install openvpn

Generate Server Certificates

sudo cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/easy-rsa2

cd /etc/openvpn/easy-rsa2

@ngocdaothanh
ngocdaothanh / gist:3764694
Created September 22, 2012 00:43
Scala Assignment: Recursion
package recfun
import scala.collection.mutable.ListBuffer
import common._
/** https://class.coursera.org/progfun-2012-001/assignment/view?assignment_id=4 */
object Main {
def main(args: Array[String]) {
println("Pascal's Triangle")
for (row <- 0 to 10) {