This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Question: | |
Design a deck of cards that can be used for different card games | |
Python 3.x | |
""" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#.git/hooks/prepare-commit-msg | |
echo `git rev-parse --abbrev-ref HEAD` >> $1 |
NewerOlder