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
From 3c148f31fba1b797322b84298eb802e479f2e809 Mon Sep 17 00:00:00 2001 | |
From: Benoit Favre <[email protected]> | |
Date: Tue, 9 Sep 2014 11:08:56 +0200 | |
Subject: [PATCH] FIX None macro from X11 colliding with Event::None and others | |
--- | |
src/she/alleg4/she_alleg4.cpp | 7 ++++++- | |
1 file changed, 6 insertions(+), 1 deletion(-) | |
diff --git a/src/she/alleg4/she_alleg4.cpp b/src/she/alleg4/she_alleg4.cpp |
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
#ifndef __STBTTF_H__ | |
#define __STBTTF_H__ | |
#include <SDL2/SDL.h> | |
#include "stb_rect_pack.h" | |
#include "stb_truetype.h" | |
/* STBTTF: A quick and dirty SDL2 text renderer based on stb_truetype and stdb_rect_pack. | |
* Benoit Favre 2019 |
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
# Proper exif rotation with PIL. Handles all the cases in https://github.com/recurser/exif-orientation-examples | |
from PIL import Image | |
image = Image.open(filename) | |
exif = image._getexif() | |
ORIENTATION = 274 | |
if exif is not None and ORIENTATION in exif: | |
orientation = exif[ORIENTATION] | |
method = {2: Image.FLIP_LEFT_RIGHT, 4: Image.FLIP_TOP_BOTTOM, 8: Image.ROTATE_90, 3: Image.ROTATE_180, 6: Image.ROTATE_270, 5: Image.TRANSPOSE, 7: Image.TRANSVERSE} | |
if orientation in method: |
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
# Proper exif rotation with PIL. Handles all the cases in https://github.com/recurser/exif-orientation-examples | |
from PIL import Image | |
image = Image.open(filename) | |
exif = image._getexif() | |
ORIENTATION = 274 | |
if exif is not None and ORIENTATION in exif: | |
orientation = exif[ORIENTATION] | |
method = {2: Image.FLIP_LEFT_RIGHT, 4: Image.FLIP_TOP_BOTTOM, 8: Image.ROTATE_90, 3: Image.ROTATE_180, 6: Image.ROTATE_270, 5: Image.TRANSPOSE, 7: Image.TRANSVERSE} | |
if orientation in method: |
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
# Proper exif rotation with PIL. Handles all the cases in https://github.com/recurser/exif-orientation-examples | |
from PIL import Image | |
image = Image.open(filename) | |
exif = image._getexif() | |
ORIENTATION = 274 | |
if exif is not None and ORIENTATION in exif: | |
orientation = exif[ORIENTATION] | |
method = {2: Image.FLIP_LEFT_RIGHT, 4: Image.FLIP_TOP_BOTTOM, 8: Image.ROTATE_90, 3: Image.ROTATE_180, 6: Image.ROTATE_270, 5: Image.TRANSPOSE, 7: Image.TRANSVERSE} | |
if orientation in method: |
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
# Proper exif rotation with PIL. Handles all the cases in https://github.com/recurser/exif-orientation-examples | |
from PIL import Image | |
image = Image.open(filename) | |
exif = image._getexif() | |
ORIENTATION = 274 | |
if exif is not None and ORIENTATION in exif: | |
orientation = exif[ORIENTATION] | |
method = {2: Image.FLIP_LEFT_RIGHT, 4: Image.FLIP_TOP_BOTTOM, 8: Image.ROTATE_90, 3: Image.ROTATE_180, 6: Image.ROTATE_270, 5: Image.TRANSPOSE, 7: Image.TRANSVERSE} | |
if orientation in method: |
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
#{ stdenv, fetchurl, SDL2, SDL2_image makeDesktopItem }: | |
with import <nixpkgs> {}; | |
stdenv.mkDerivation rec { | |
pname = "brogue-ce"; | |
version = "1.8.3"; | |
src = fetchFromGitHub { | |
owner = "tmewett"; | |
repo = "BrogueCE"; |
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
# Extract a docker image retrieved with docker_pull.py (https://github.com/NotGlop/docker-drag) | |
import tarfile | |
import sys, json | |
# The tar contains a manifest.json which lists layers; each layer is a tar archive | |
with tarfile.TarFile(sys.argv[1]) as tf: | |
with tf.extractfile("manifest.json") as manifest_fp: | |
manifest = json.loads(manifest_fp.read()) | |
for layername in manifest[0]['Layers']: | |
with tf.extractfile(layername) as layer_fp: |
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
import net | |
var | |
sslContext = newContext(certFile = "fullchain.pem", keyFile = "privkey.pem", verifyMode = CVerifyPeer) | |
socket = newSocket(domain = AF_INET6) | |
socket.setSockOpt(OptReuseAddr, true) | |
socket.setSockOpt(OptReusePort, false) | |
socket.bindAddr(Port(1965), "::") | |
socket.listen() | |
sslContext.wrapSocket(socket) |
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
import openssl | |
import ssl_config | |
from ssl_certs import scanSSLCertificates | |
import nativesockets | |
import uri | |
import os | |
import strutils | |
type Socket = ref object | |
fd: SocketHandle |
OlderNewer