I hereby claim:
- I am glasnt on github.
- I am glasnt_ (https://keybase.io/glasnt_) on keybase.
- I have a public key whose fingerprint is F026 9B50 5233 B0C9 8D1E 037C CA63 6DA6 7DA9 A6F6
To claim this, I am signing this object:
web: ./main.py |
from datasette.database import Database | |
from datasette import hookimpl | |
from datasette.utils.asgi import Response | |
import os | |
` | |
async def reload_db(datasette): | |
spec = datasette.plugin_config('datasette-reload-db') | |
db_dir = os.listdir(spec['dir']) | |
databases = datasette.databases |
# Based on : https://groups.google.com/d/msg/sage-devel/1lIJ961gV_w/y-2uqPCyzUMJ | |
import os | |
def ncpus(): | |
#for Linux, Unix and MacOS | |
if hasattr(os, "sysconf"): | |
if "SC_NPROCESSORS_ONLN" in os.sysconf_names: | |
#Linux and Unix | |
ncpus = os.sysconf("SC_NPROCESSORS_ONLN") | |
if isinstance(ncpus, int) and ncpus > 0: | |
return ncpus |
""" | |
My first application | |
""" | |
import toga | |
from toga.style import Pack | |
from toga.style.pack import COLUMN, ROW | |
class HelloWorld(toga.App): | |
def startup(self): |
function openTab() { | |
var selection = SpreadsheetApp.getActiveSheet().getActiveCell().getValue(); | |
var html = "<script>window.open('" + selection + "');google.script.host.close();</script>"; | |
var userInterface = HtmlService.createHtmlOutput(html); | |
SpreadsheetApp.getUi().showModalDialog(userInterface, 'Open Tab'); | |
} |
I hereby claim:
To claim this, I am signing this object:
from __future__ import print_function | |
import sys | |
import random | |
from collections import deque | |
from PIL import Image | |
# THIS IS THE MAGIC VALUE THAT MAKES EVERYTHING GLITCHED |
""" | |
Usage: python3 regional.py list of words | |
Prints a representation of the words as Regional Identifiers, and copies the output directly to keyboard for you | |
This is because some terminals think that zero width spaces are silly. | |
Currently supports: A-Z | |
Requires: Python 3 | |
Now less complex, thanks @bmispelon! | |
""" |
<!doctype html> | |
<script src="https://code.shutterstock.com/rickshaw/vendor/d3.v2.js"></script> | |
<script src="https://code.shutterstock.com/rickshaw/rickshaw.min.js"></script> | |
<div id="chart"></div> | |
<script> | |
// Return an xinterp function for a given graph | |
function xinterp_on_graph(graph) { |