When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
// Simple gist to test parallel promise resolution when using async / await | |
function promiseWait(time) { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve(true); | |
}, time); | |
}); | |
} |
import asyncio | |
import random | |
import time | |
async def worker(name, queue): | |
while True: | |
# Get a "work item" out of the queue. | |
sleep_for = await queue.get() |
#!/bin/bash | |
set -ex | |
THISSCRIPTPATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
cd $THISSCRIPTPATH | |
echo "This script is for building Caffe2 locally (not in /usr/lib) on Ubuntu 16.04" | |
echo "Can be used for Python virtual environments" | |
echo "This assumes OpenCV is already installed: https://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/" | |
my_python_version=$(python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))") |
# | |
# written for Amazon Linux AMI | |
# creates an AWS Lambda deployment package for pytorch deep learning models (Python 3.6.1) | |
# assumes lambda function defined in ~/main.py | |
# deployment package created at ~/waya-ai-lambda.zip | |
# | |
# | |
# install python 3.6.1 | |
# |
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard
from sqlalchemy.dialects import postgresql | |
def bulk_upsert(session: Session, | |
items: Sequence[Mapping[str, Any]]): | |
session.execute( | |
postgresql.insert(MyModel.__table__) | |
.values(items) | |
.on_conflict_do_update( | |
index_elements=[MyModel.id], | |
set_={MyModel.my_field.name: 'new_value'}, |
keywords = { | |
["date"] = function() return os.date("%B %d, %Y") end, | |
["name"] = "my name is MISTER", | |
} | |
expander = hs.hotkey.bind({"alt"}, "d", nil, function() -- don't start watching until the keyUp -- don't want to capture an "extra" key at the begining | |
local what = "" | |
local keyMap = require"hs.keycodes".map -- shorthand... in a formal implementation, I'd do the same for all `hs.XXX` references, but that's me | |
local keyWatcher | |
keyWatcher = hs.eventtap.new({ hs.eventtap.event.types.keyUp, hs.eventtap.event.types.keyDown }, function(ev) |
Businesses are machines producing mountains of data about sales, usage, customer, costs, etc... Traditionally data processing is highly centralised with teams of staff and computer running hot a whirling ready to process. We can do better than moving the mountain of data into the corporate data machine - so long as that machinary is light enough to be moved to the data.
We've had this problem; a huge directory of files in CSV format, conataining vital information for our business. But it's in CSV, requires analysis, and don't you don't feel like learning sed/grep/awk today - besides it's 2017 and no-one thinks those tools are easy to use.