Skip to content

Instantly share code, notes, and snippets.

@zunayed
zunayed / rockpaperscissors.py
Last active January 31, 2019 21:13 — forked from asafshkalim/rockpaperscissors.py
Rock Paper Scissors game (Python)
import time
import random
GAME_CHOICES = ['rock', 'paper', 'scissors']
def random_choice():
return random.choice(GAME_CHOICES)
@zunayed
zunayed / gist:fcff48a276c28f9839d2
Last active August 29, 2015 14:06
Watching variables while debugging for prestige projects

I finally took Josh's advice and started digging deeper into Pycharms visual debugger. But I quickly ran into an issue using envdir for our prestige projects. There doesn't seem like there is a way to prepend the django manage.py command with envdir. So I modified the manage.py file with these few lines to load your envdir/ folder. The added benefit of this is you can just type python /manage.py runserver. Otherwise you would have to manually enter all the required Enviromental variables into pycharm by hand and also track the changes. I figured I share this.

if 'local' in sys.argv:
    env_dir = os.path.join('local', 'envdir')
else:
    env_dir = 'envdir/dev'
@zunayed
zunayed / cities.csv
Last active January 14, 2022 23:20
D3 world map plus animation
place lat lon
New York City 40.6452217 -73.9493866
London 51.5064316 -0.12719
Montreal 45.5172005 -73.5498962
Toronto 43.6483994 -79.4857025
@zunayed
zunayed / noisy_nyc_py
Created December 2, 2013 17:26
Noisiest neighborhoods in NYC
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="http://d3js.org/d3.v3.min.js"></script>
</head>
<body>
<style>
{
"metadata": {
"name": "311 Data"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{