I hereby claim:
- I am dyspop on github.
- I am danblack (https://keybase.io/danblack) on keybase.
- I have a public key ASCJnHihWA0wrXdnJQ0MwSBUWIgHkpAY0HAErhpgl6VE1Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
""" Tic tac toe code exercise with dataclasses. | |
Usage: | |
import tictactoe as ttt | |
game = ttt.Game() | |
game.make_move(x, y) | |
""" |
shutterstock_header_core_center | |
hero_copy | |
text_paragraph_center-1 | |
feature_right-1 | |
feature_left-1 | |
<#if SHUTTERSTOCK_IMG_MUSIC_FOOTAGE_EDITORAL_PET.COUNTRY='US' || SHUTTERSTOCK_IMG_MUSIC_FOOTAGE_EDITORAL_PET.COUNTRY = 'GB' || SHUTTERSTOCK_IMG_MUSIC_FOOTAGE_EDITORAL_PET.COUNTRY = 'DE' >text_paragraph_center-2</#if> | |
<#if SHUTTERSTOCK_IMG_MUSIC_FOOTAGE_EDITORAL_PET.COUNTRY='US' || SHUTTERSTOCK_IMG_MUSIC_FOOTAGE_EDITORAL_PET.COUNTRY = 'GB'>feature_right-2</#if> | |
<#if SHUTTERSTOCK_IMG_MUSIC_FOOTAGE_EDITORAL_PET.COUNTRY='US' || SHUTTERSTOCK_IMG_MUSIC_FOOTAGE_EDITORAL_PET.COUNTRY = 'GB' || SHUTTERSTOCK_IMG_MUSIC_FOOTAGE_EDITORAL_PET.COUNTRY = 'DE' >feature_left-2</#if> | |
text_paragraph_center-3 | |
shutterstock_marketing_footer_inverse |
import json | |
import requests | |
# Ask the user for the set abbreviation. | |
setabbrv = input("What's the abbreviation of the set?\n") | |
# Define the URL to look it up from | |
lookupobject = "https://api.scryfall.com/cards/search?order=name&q=set:" + setabbrv | |
# Make a get request and convert the json response to a dictionary | |
resp = json.loads(requests.get(lookupobject).text) |
# fix owner of files and folders recursively | |
sudo chown -vR $(whoami) /usr/local /opt/homebrew-cask /Library/Caches/Homebrew | |
# fix read/write permission of files and folders recursively | |
chmod -vR ug+rw /usr/local /opt/homebrew-cask /Library/Caches/Homebrew | |
# fix execute permission of folders recursively | |
find /usr/local /opt/homebrew-cask /Library/Caches/Homebrew -type d -exec chmod -v ug+x {} + |
class_properties = ['foo', 'bar', 'baz'] | |
for prop in class_properties: | |
print(f''' | |
@property | |
def {prop}(self): | |
"""Get {prop}.""" | |
return self.__{prop} | |
@{prop}.setter |
"""Tests for each individual function in the Client.""" | |
import responsysrest as r | |
def dict_contains_key(d, k): | |
"""Test if the key is in the dictionary.""" | |
return k in d | |
def test_get_context(): |
# Polymer Mallard - Bash CRUD | |
# | |
# Put the following into your ~/.bash_rc or ~/.bash_profile | |
# Requires Python, cURL | |
function pmCrudRequest { | |
printf " \n \e[1;33m$method\e[0m from \e[1;33m$url\e[0m \n \n" | |
printf " \n \e[0;32m" | |
echo "$response" | python -m json.tool | |
printf "\e[0m" |
#!/bin/bash | |
alias ll='ls -hartlG' | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="🤖 \h\n👤 \u\n📁 \w\n🌳 \$(parse_git_branch)\n🤘 " |
from PIL import Image | |
filename = 'pastries.jpg' | |
image = Image.open(filename) | |
# get average color | |
# inspiration from https://gist.github.com/olooney/1246268 | |
def average_image_color(imagedata): | |
channel_histograms = {} | |
color_averages = {} |