Skip to content

Instantly share code, notes, and snippets.

View qunwang6's full-sized avatar
🏠
Working from home

qunwang6

🏠
Working from home
View GitHub Profile
wget --no-check-certificate --recursive --domains=opensource.apple.com --no-clobber --accept "*.gz" --no-parent -l2 https://opensource.apple.com/tarballs
wget --no-check-certificate --recursive --domains=opensource.apple.com --no-clobber --accept "*.gz" -l2 https://opensource.apple.com/
wget --no-check-certificate --recursive --domains=opensource.apple.com --no-clobber --accept "*.gz" --no-parent -l3 https://opensource.apple.com/darwinbuild/
#if 0
Reported : 19-Jan-2020
Fixed in iOS 13.4 with CVE-2020-9768
AppleJPEGDriverUserClient : mach port use-after-free/type-confusion via race condition
AppleJPEGDriverUserClient external methods can be used synchronously or asynchronously, when used asynchronously,
it brings the registered mach port (via registerNotificationPort()) and put it inside jpegRequest data structure,
and no reference count was taken for this operation. since registerNotificationPort() is not gated, it is
possible to release the port (if the port got substituted) during the processing of jpeg request and end up
with dangling pointer passed to _mach_msg_send_from_kernel_proper().
@Rami-Sabbagh
Rami-Sabbagh / Matrix.lua
Last active April 7, 2018 10:10
Raspberry Pi Lua GPIO LED Matrix
--LED Matrix RAMI
local json = dofile("/home/pi/Desktop/Matrix/json.lua")
local socket = require("socket")
local periphery = require('periphery')
local GPIO = periphery.GPIO
print("Using GPIO:",GPIO.version)
@sydney0zq
sydney0zq / httpserver_qr.py
Last active December 13, 2017 14:36
simplehttpserver_with_qr_terminal
#!/usr/bin/env python3
import os
import html
import urllib
import sys
import http
import cgi
import socket
import socketserver

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 00:25
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@diyism
diyism / dns2https.php
Last active July 26, 2021 13:42
dns2https.php
<?php
/*
udp/tcp dns client for google dns over https (https://dns.google.com)
ubuntu上使用:
在/etc/rc.local里加/usr/bin/php /home/<your_name>/dns2https.php
执行:
systemctl disable unbound
systemctl disable dnscrypt-proxy
@dannguyen
dannguyen / README.md
Last active December 28, 2023 15:21
Using Python 3.x and Google Cloud Vision API to OCR scanned documents to extract structured data

Using Python 3 + Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

@steventroughtonsmith
steventroughtonsmith / Foundation.py
Last active November 15, 2023 23:48
UIKit+UIFoundation & Foundation for Pythonista - autoconverted from SDK tbd (includes non-public SPI)
# coding: utf-8
from objc_util import *
NSAKDeserializer = ObjCClass('NSAKDeserializer')
NSAKDeserializerStream = ObjCClass('NSAKDeserializerStream')
NSAKSerializer = ObjCClass('NSAKSerializer')
NSAKSerializerStream = ObjCClass('NSAKSerializerStream')
NSAbstractLayoutGuide = ObjCClass('NSAbstractLayoutGuide')
NSAddressCheckingResult = ObjCClass('NSAddressCheckingResult')
NSAffineTransform = ObjCClass('NSAffineTransform')
@cloudwu
cloudwu / mymod.user.lua
Created October 26, 2015 12:05
user defined loader
local M = {}
function M.test(...)
print(...)
end
return M