Version: 2022.03.02
This file contains 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
# ./.flake8 | |
[flake8] | |
max-line-length=111 | |
exclude=src/dapple/_version.py | |
ignore=E231,W503,E203,E265,D103,D100,D101,D102,D104,D105,D107,D401,D400,D205 |
This file contains 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
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html | |
[tool.pytest.ini_options] | |
pythonpath = [ "src", "tests" ] | |
norecursedirs = [ | |
"tests/testkit" | |
] | |
[tool.black] | |
line-length=111 |
The package linked to from here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
This file contains 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
public double doIt(BufferedImage image) { | |
final double skewRadians; | |
BufferedImage black = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_BYTE_BINARY); | |
final Graphics2D g = black.createGraphics(); | |
g.drawImage(image, 0, 0, null); | |
g.dispose(); | |
skewRadians = findSkew(black); | |
System.out.println(-57.295779513082320876798154814105 * skewRadians); | |
return skewRadians; |
This file contains 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
#!/bin/bash | |
# | |
# Self-contained command line processing in bash that supports the | |
# minimal, lowest common denominator compatibility of flag parsing. | |
# -u: undefined variables is an error | |
# -e: exit shell on error | |
set -eu | |
function usage() { |
This file contains 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
// If the user has been on the page for over 12 hours, the next link | |
// click will do a full page transition to get new code | |
import React from "react"; | |
import { BrowserRouter, useLocation } from "react-router-dom"; | |
let hour = 3600000; | |
export default function StaleAppRouter(props) { | |
let [isStale, setIsStale] = useState(false); |
This file contains 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
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c | |
[metadata] | |
name = {name} | |
version = {version} | |
author = Martin Larralde | |
author-email = [email protected] | |
home-page = https://github.com/althonos/{name} | |
description = {description} | |
long-description = file: README.rst, CHANGELOG.rst |
This file contains 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
#!/usr/bin/env python | |
# source: http://www.joedog.org/pub/AJP/ajping.txt | |
from struct import unpack | |
import time | |
import sys | |
import socket | |
acks = set([65, 66, 0, 1, 9]) |
This file contains 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
library(ggplot2) | |
library(MASS) | |
## generate some random data | |
data <- data.frame(a=abs(rnorm(1000, mean=0.5)), b=abs(rnorm(1000, mean=0.5))) | |
data$a <- data$a / max(data$a) | |
data$b <- data$b / max(data$b) | |
## layout settings for ggplot |
NewerOlder