Skip to content

Instantly share code, notes, and snippets.

View voroninman's full-sized avatar
🇺🇦

Viktor Voronin voroninman

🇺🇦
View GitHub Profile
"""
Code snippet for changing Django user's password.
It implies that your unique user's field is email.
Start Django's shell and run code below:
cd /path/to/project
python manage.py shell
Or use built-in `changepassword` command:
cd /path/to/project
"""
Question:
Design a deck of cards that can be used for different card games
Python 3.x
"""
"""
Question:
Suppose I had a network of switches, or more generally, Nodes. Each Node
has a method getNeighbors(), which returns a set of adjacent Nodes in the
network. Write a function findNeighborhood(Node, n) which given a Node and
int n returns all nodes no more than n hops away.
Python 3.x
for (var items = document.querySelectorAll('[id*="audio_info"]'), l = items.length - 1; l >= 0; l--) {
try {
console.log(items[l].value.match(/.*\.mp3/)[0]);
} catch (e) {}
}
#!/bin/bash
#.git/hooks/prepare-commit-msg
echo `git rev-parse --abbrev-ref HEAD` >> $1