Skip to content

Instantly share code, notes, and snippets.

View chrismullins's full-sized avatar

Christopher Mullins chrismullins

View GitHub Profile

User authentication system

Your task is now to create a user authentication system.

This document will guide you through all the features and implication of such system, so that you don't have to search them yourself.

We will focus on web/browser-technologies, however similar concept can be widely applied. This guide, is a work in progress, feel free to comment and provide feedbacks.

Expected Workflows

@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb

Unary operators

(and the oddities of number evaluation in JavaScript)

Type conversion, typecasting, and coercion are different ways of, implicitly or explicitly, changing an entity of one data type into another. [--wikipedia][wikipedia]


Unary operators, or "typeof +'foo' === huh?"

@cansadadeserfeliz
cansadadeserfeliz / forms.py
Created June 19, 2014 20:35
Django: pass a variable from a form view to a form
class MyForm(forms.ModelForm):
requested_asset = None
def __init__(self, *args, **kwargs):
other_variable = kwargs.pop('other_variable')
super(MyForm, self).__init__(*args, **kwargs)