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 PIL import Image | |
from PIL import ImageDraw | |
import lazyopt | |
import random | |
import os | |
this_dir = os.getcwd() | |
images_dir = os.path.join(this_dir,'images') |
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
def hokey_pokey(self): | |
for appendage in [ "left_hand", | |
"right_hand", | |
"left_foot", | |
"right_foot", | |
"whole_head"] : | |
self.put_in(getattr(self,appendage)) | |
self.take_out(getattr(self,appendage)) | |
self.shake_about(getattr(self,appendage)) | |
# it's not really recursive. |
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
# fixed way | |
def check_for_flow(self): | |
if self.terrain_type == 'grass': | |
return False | |
neighbors = engine.metagrid.get_neighbors(self.pos) | |
flow_dirs = [] | |
for direction in ORDINALS: |
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
def check_for_flow(self): | |
if self.terrain_type == 'grass': | |
return False | |
neighbors = engine.metagrid.get_neighbors(self.pos) | |
did_flow = False | |
for direction in ORDINALS: | |
these_neighbors = neighbors.get(direction) or {} | |
ground_neighbor = these_neighbors.get(LAYER_GROUND) |
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 PIL import Image | |
i = Image.open('static/images/dudes/sheep-2.png') | |
new_image = Image.new(i.mode, (256,256)) | |
size_per_image = 128 | |
real_image_size = 64 | |
# for changing old sheep with spacing to new sheep | |
def map_portion(x_num, y_num): | |
start_x = x_num*size_per_image + 32 |
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 a post | |
"message_tags": { | |
"9": [ | |
{ | |
"id": "849191185199284", | |
"name": "Mark Chandler", | |
"type": "user", | |
"offset": 9, | |
"length": 13 |
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
{"meta":{},"content":{"sites":[{"title":"javascript - Get website's favicon with JS - Stack Overflow","url":"https://stackoverflow.com/questions/2057636/get-websites-favicon-with-js","timestamp_ms":1646504705389},{"title":"Chrome extensions: Local storage - DEV Community","url":"https://dev.to/paulasantamaria/chrome-extensions-local-storage-1b34","timestamp_ms":1646504706970},{"title":"javascript localStorage in extension at DuckDuckGo","url":"https://duckduckgo.com/?q=javascript+localStorage+in+extension&t=brave&ia=web","timestamp_ms":1646504708178},{"title":"Migrating from background pages to service workers - Chrome Developers","url":"https://developer.chrome.com/docs/extensions/mv3/migrating_to_service_workers/","timestamp_ms":1646504709302},{"title":"Samples - Chrome Developers","url":"https://developer.chrome.com/docs/extensions/mv3/samples/","timestamp_ms":1646504712334},{"title":"javascript - Get website's favicon with JS - Stack Overflow","url":"https://stackoverflow.com/questions/2057636/get-website |
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
{"meta":{},"content":{"sites":[{"title":"javascript - Get website's favicon with JS - Stack Overflow","url":"https://stackoverflow.com/questions/2057636/get-websites-favicon-with-js","timestamp_ms":1646504705389},{"title":"Chrome extensions: Local storage - DEV Community","url":"https://dev.to/paulasantamaria/chrome-extensions-local-storage-1b34","timestamp_ms":1646504706970},{"title":"javascript localStorage in extension at DuckDuckGo","url":"https://duckduckgo.com/?q=javascript+localStorage+in+extension&t=brave&ia=web","timestamp_ms":1646504708178},{"title":"Migrating from background pages to service workers - Chrome Developers","url":"https://developer.chrome.com/docs/extensions/mv3/migrating_to_service_workers/","timestamp_ms":1646504709302},{"title":"Samples - Chrome Developers","url":"https://developer.chrome.com/docs/extensions/mv3/samples/","timestamp_ms":1646504712334},{"title":"javascript - Get website's favicon with JS - Stack Overflow","url":"https://stackoverflow.com/questions/2057636/get-website |
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
{"meta":{},"content":{"sites":[{"title":"javascript - Get website's favicon with JS - Stack Overflow","url":"https://stackoverflow.com/questions/2057636/get-websites-favicon-with-js","timestamp_ms":1646504705389},{"title":"Chrome extensions: Local storage - DEV Community","url":"https://dev.to/paulasantamaria/chrome-extensions-local-storage-1b34","timestamp_ms":1646504706970},{"title":"javascript localStorage in extension at DuckDuckGo","url":"https://duckduckgo.com/?q=javascript+localStorage+in+extension&t=brave&ia=web","timestamp_ms":1646504708178},{"title":"Migrating from background pages to service workers - Chrome Developers","url":"https://developer.chrome.com/docs/extensions/mv3/migrating_to_service_workers/","timestamp_ms":1646504709302},{"title":"Samples - Chrome Developers","url":"https://developer.chrome.com/docs/extensions/mv3/samples/","timestamp_ms":1646504712334},{"title":"javascript - Get website's favicon with JS - Stack Overflow","url":"https://stackoverflow.com/questions/2057636/get-website |
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
{"meta":{},"content":{"sites":[{"title":"javascript - Get website's favicon with JS - Stack Overflow","url":"https://stackoverflow.com/questions/2057636/get-websites-favicon-with-js","timestamp_ms":1646504705389},{"title":"Chrome extensions: Local storage - DEV Community","url":"https://dev.to/paulasantamaria/chrome-extensions-local-storage-1b34","timestamp_ms":1646504706970},{"title":"javascript localStorage in extension at DuckDuckGo","url":"https://duckduckgo.com/?q=javascript+localStorage+in+extension&t=brave&ia=web","timestamp_ms":1646504708178},{"title":"Migrating from background pages to service workers - Chrome Developers","url":"https://developer.chrome.com/docs/extensions/mv3/migrating_to_service_workers/","timestamp_ms":1646504709302},{"title":"Samples - Chrome Developers","url":"https://developer.chrome.com/docs/extensions/mv3/samples/","timestamp_ms":1646504712334},{"title":"javascript - Get website's favicon with JS - Stack Overflow","url":"https://stackoverflow.com/questions/2057636/get-website |
OlderNewer