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
| from functools import lru_cache | |
| @lru_cache(None) | |
| def fib(n): | |
| return n if n < 2 else fib(n-1) + fib(n-2) |
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
| [Desktop Entry] | |
| Type=Application | |
| Name=Godot | |
| GenericName=Game engine | |
| Comment=2D and 3D game engine | |
| Exec=/home/username/Public/Godot_v3.0.6-stable_x11.64 | |
| Icon=/home/username/Public/godot.png |
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
| from contextlib import contextmanager | |
| from inspect import currentframe, getouterframes | |
| @contextmanager | |
| def let(**bindings): | |
| frame = getouterframes(currentframe(), 2)[-1][0] # 2 because first frame in `contextmanager` decorator | |
| locals_ = frame.f_locals | |
| original = {var: locals_.get(var) for var in bindings.keys()} | |
| locals_.update(bindings) | |
| yield |
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
| import sys | |
| import os | |
| # Get the absolute path from the current file | |
| # Get the file's directory | |
| sys.path.append(os.path.dirname(os.path.abspath(__file__))) | |
| # If you don't have access to the __file__ global | |
| sys.path.append(os.path.dirname(os.path.abspath(sys.argv[0]))) | |
| # Print the last item in the path |
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
| from markdown2 import Markdown | |
| import os | |
| markdown = Markdown() | |
| for root, dirs, files in os.walk("/var/www/html", topdown=False): | |
| for name in files: | |
| if name.endswith(".md"): | |
| filename = os.path.join(root, name) | |
| with open(filename, 'r') as md_file: | |
| html_filename = os.path.join(root, "{}.html".format(os.path.splitext(filename)[0])) |
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
| - height*moisture: | |
| - 1@2:rock,1:snow | |
| - 2@1:sand,2:dirt,2:grass | |
| - 3@1:=water | |
| - tile*population: | |
| - sand@9:-,1:buildings | |
| - grass,dirt@3:-,1:buildings |
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
| - height*curse: | |
| - 1@25:-,1:=curse | |
| - height*moisture: | |
| - 1@2:rock,1:snow | |
| - 1@2:grass,3:plants | |
| - 2@moisture*fertility: | |
| - 1@1:dirt,2:grass,3:plants | |
| - 2@2:dirt,3:grass,1:plants | |
| - 1@3:sand,2:dirt | |
| - 1@2:sand,1:dirt,1:grass,1:plants,2:=water |
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
| let username = ""; | |
| let repo = ""; | |
| window.onload = () => { | |
| fetch(`https://api.github.com/repos/${username}/${repo}/releases/latest`).then(response => { | |
| response.json().then(json => { | |
| console.log(json); | |
| }); | |
| }); | |
| } |
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
| extends Area | |
| onready var viewport = $"../Viewport" | |
| onready var collion = $CollisionShape | |
| var last_collided = Vector3.ZERO | |
| var mouse_mask = 0 | |
| var mesh_size_x = 0.5 | |
| var mesh_size_y = 0.5 | |
| var uv_offset_x = -0.1 | |
| var uv_offset_y = -0.1 |
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
| from os import path | |
| import yaml | |
| import json | |
| import sys | |
| if len(sys.argv) < 2: | |
| print("Please provide a file name") | |
| quit() | |
| filename = sys.argv[1] |
OlderNewer