Skip to content

Instantly share code, notes, and snippets.

from hashlib import sha1
import time
import random
import uuid
def get_digest(password, nonce, created):
""" Returns the password's expected digest.
"""
nonce = nonce.decode('base64')
concat = nonce + created + password

Keybase proof

I hereby claim:

  • I am adniel on github.
  • I am adniel (https://keybase.io/adniel) on keybase.
  • I have a public key whose fingerprint is 3B26 B460 B3F9 2854 F879 C15F 721E 97CE 474A D84A

To claim this, I am signing this object:

@Adniel
Adniel / manifest_gist.cfg
Last active August 29, 2015 13:57
Generate link in theme from action with diazo
# create a href for diazo theming through manifest.cfg
mystuff = python: portal.portal_actions.getActionInfo("user/mystuff").get('url')
@Adniel
Adniel / cover-to-bootstrap3.xml
Created March 22, 2014 16:47
Fix columns in collective.cover to bootstrap3
<?xml version="1.0" encoding="UTF-8"?>
<rules
xmlns="http://namespaces.plone.org/diazo"
xmlns:css="http://namespaces.plone.org/diazo/css"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- fix cover -->
<replace content="body[contains(@class, 'portaltype-collective-cover-content')]//div[contains(@class, 'width-1')]">
<xsl:copy>