Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| import pygame as pg,sys | |
| pg.init() | |
| w=pg.display.set_mode((100,)*2) | |
| o=list(open(sys.argv[1]).read().replace("\n","")) | |
| px=py=50 | |
| j=0 | |
| k=pg.key.get_pressed | |
| t=lambda x,y:o[x/5+y/5*20] | |
| z=lambda i:min(95,max(0,i)) | |
| while True: |
| #!/usr/bin/env python | |
| # | |
| # Python Timer Class - Context Manager for Timing Code Blocks | |
| # Corey Goldberg - 2012 | |
| # | |
| from timeit import default_timer |
| (use '[clojure.core.match :only [match]]) | |
| (defn evaluate [env [sym x y]] | |
| (match [sym] | |
| ['Number] x | |
| ['Add] (+ (evaluate env x) (evaluate env y)) | |
| ['Multiply] (* (evaluate env x) (evaluate env y)) | |
| ['Variable] (env x))) | |
| (def environment {"a" 3, "b" 4, "c" 5}) |
| /* | |
| Copyright (C) 2021 Pascal de Vink (Tweakers.net) | |
| This library is free software; you can redistribute it and/or | |
| modify it under the terms of the GNU Lesser General Public | |
| License as published by the Free Software Foundation; either | |
| version 2.1 of the License, or (at your option) any later version. | |
| This library is distributed in the hope that it will be useful, | |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| # nanoshorten - a very tiny URL shortener Web application written in Bottle and sqlite | |
| # copyright (c) 2012 darkf | |
| # licensed under the WTFPL (WTF Public License) | |
| # see http://sam.zoy.org/wtfpl/ for details | |
| from bottle import get, request, run | |
| import sqlite3, random, string | |
| con = sqlite3.connect('short.db') | |
| c = con.cursor() |
| #!/usr/bin/env python | |
| import os | |
| import random | |
| import time | |
| import platform | |
| snowflakes = {} | |
| try: | |
| # Windows Support |