Skip to content

Instantly share code, notes, and snippets.

from PIL import Image
from pytesseract import *
pytesseract.tesseract_cmd = r'C:\Users\Usuario\AppData\Local\Programs\Tesseract-OCR\tesseract.exe'
img = Image.open("image.png")
resultado = pytesseract.image_to_string(img)
print(resultado)
@shinoi2
shinoi2 / renju.py
Last active May 21, 2024 03:42
Python - 五子棋禁手判断
BOARD_SIZE = 15
NULL = 0
BLACK = 1
WHITE = 2
dx = [-1, 0, 1, -1, 1, -1, 0, 1]
dy = [-1, -1, -1, 0, 0, 1, 1, 1]
class IllegalMove(Exception):
pass
@magnetikonline
magnetikonline / README.md
Last active May 21, 2024 03:38
Enable LDAP over SSL (LDAPS) for Microsoft Active Directory servers.

Enable LDAP over SSL (LDAPS) for Microsoft Active Directory servers

Tip

Microsoft active directory servers by default provide LDAP connections over unencrypted connections (boo!).

The steps below will create a new self signed certificate appropriate for use with and thus enabling LDAPS for an AD server. Of course the "self-signed" portion of this guide can be swapped out with a real vendor purchased certificate if required.

Steps have been tested successfully with Windows Server 2012R2, but should work with Windows Server 2008 without modification. Requires a working OpenSSL install (ideally Linux/OSX) and (obviously) a Windows Active Directory server.

@gabe565
gabe565 / change-arc-icon.md
Last active May 21, 2024 03:37
Change Arc Browser Icon

Change Arc Browser Icon

arc

A collection of commands that change the Arc Browser icon on macOS.

Commands

Theme Command
Candy Arc defaults write company.thebrowser.Browser currentAppIconName candy
@mili-inch
mili-inch / vmc4b_manual_en.md
Last active May 21, 2024 03:35
Manual for VMC4B

This is an add-on that receives motions sent by VMCProtocol. It previews, records them in real time in Blender. About VMCProtocol: https://protocol.vmc.info/

It can be used with VirtualMotionCapture to capture SteamVR motions.
https://vmc.info/

Currently, VirtualMotionCapture motion sending function is a paid feature (2021/11/16).
https://akira.fanbox.cc/

screenshot

@Mikael-R
Mikael-R / scrollable.vue
Created January 2, 2024 17:20
Scrollable component for vue
<template>
<div
ref="scrollContainer"
class="overflow-auto"
:class="state.dragging ? 'cursor-grabbing' : 'cursor-grab'"
@mousedown="handleMouseDown"
@mousemove="handleMouseMove"
@mouseup="handleMouseUp"
>
<div ref="content" class="content" @selectstart="handleSelectStart">

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@jgreely
jgreely / smartdown.sh
Created September 5, 2021 06:28
Bash script to convert Hugo markdown files to smartquotes, since Goldmark sucks at it
#!/usr/bin/env bash
#
# add smart quotes to Hugo Markdown source files, using the
# reference implementation of CommonMark's CLI tool:
# https://github.com/commonmark/commonmark-spec
# Notes:
# - assumes TOML front matter
# - converts footnote-style links to inline
# - normalizes ordered/unordered list formatting
#
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE