Steps with explanations to set up a server using:
- Virtualenv
- Virtualenvwrapper
- Django
- Gunicorn
| from django import forms | |
| class Form(forms.Form): | |
| field = forms.TypedChoiceField(coerce=lambda x: x =='True', | |
| choices=((False, 'No'), (True, 'Yes'))) |
Custom social sharing buttons for Twitter, Facebook, Google Plus, LinkedIn, StumbleUpon, and Pinterest.
via http://siliconstation.com/how-develop-custom-google-plus-button/
<a class="icon-twitter" rel="nofollow"
href="http://twitter.com/"In your command-line run the following commands:
brew doctorbrew update| const genMatrix = (args) => { | |
| return Array.isArray(args) ? args.map((item) => genMatrix(item)) | |
| : Array.apply(null, {length: args}).map(() => false) | |
| } | |
| const genMatrix2 = (args) => { | |
| if (Array.isArray(args)) { | |
| return args.map((item) => genMatrix2(item)) | |
| } | |
| else { |
| #!/usr/bin/python | |
| div1 = ["Lions", "Tigers", "Jaguars", "Cougars"] | |
| div2 = ["Whales", "Sharks", "Piranhas", "Alligators"] | |
| div3 = ["Cubs", "Kittens", "Puppies", "Calfs"] | |
| def create_schedule(list): | |
| """ Create a schedule for the teams in the list and return it""" | |
| s = [] |
| def create_balanced_round_robin(players): | |
| """ Create a schedule for the players in the list and return it""" | |
| s = [] | |
| if len(players) % 2 == 1: players = players + [None] | |
| # manipulate map (array of indexes for list) instead of list itself | |
| # this takes advantage of even/odd indexes to determine home vs. away | |
| n = len(players) | |
| map = list(range(n)) | |
| mid = n // 2 | |
| for i in range(n-1): |
| let teams = [ | |
| 'Tigers', | |
| 'Foofels', | |
| 'Drampamdom', | |
| 'Lakebaka' | |
| ] | |
| const roundRobin = (teams) => { | |
| let schedule = [] | |
| let league = teams.slice() |
| var candies1 = [3, 4, 7, 7, 6, 6] | |
| var candies2 = [5, 1, 12, 12, 12, 5, 6, 8, 8, 5] | |
| var candies3 = [80, 80, 1000000000, 80, 80, 80, 80, 80, 80, 123456789] | |
| var candies = [5, 1, 12, 12, 12, 5, 6, 8, 8, 5] | |
| var typesOfCandies = function(arr) { | |
| var finalResult = {}; | |
| var counting = arr.reduce(function(result, current) { |