Skip to content

Instantly share code, notes, and snippets.

View zhaoxiaobao's full-sized avatar
🤒
Out sick

zhaoyuan zhaoxiaobao

🤒
Out sick
View GitHub Profile
@DickyT
DickyT / icloud.js
Created December 6, 2019 12:30
Trigger Find My iPhone Alarm with Puppeteer
const puppeteer = require('puppeteer');
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const playSoundOnDevice = async (username, password, deviceName) => {
const browser = await puppeteer.launch({
args: [
'--disable-features=site-per-process',
#!/usr/bin/env python2
# lrdcq
# usage python2 unwxapkg.py filename
import sys, os
import struct
class WxapkgFile(object):
nameLen = 0
{"lastUpload":"2020-04-30T04:17:22.471Z","extensionVersion":"v3.4.3"}
@lzl
lzl / meteor-mongodb-backup-restore.md
Last active March 16, 2020 02:06
备份/恢复 Meteor 的 MongoDB 数据库

准备工作:

  1. 安装 Meteor
  2. 安装 Homebrew,是为了更方便地安装 MongoDB。
  3. 安装 MongoDB,是为了使用里面的 mongodumpmongorestore

备份与恢复本地数据库 (localhost):

  1. 在想要备份的应用目录下,meteor run
  2. 还是在相应的应用目录下,meteor mongo,查看相应的端口号,比如:如果显示的是 connecting to: 127.0.0.1:3001/meteor,那么端口号就是3001,下一步要用到。
@rupertqin
rupertqin / cities-latlng.js
Last active January 15, 2023 17:50
中国省市经纬度 JSON
var citiesLatLng = {
"municipalities": [
{
"name": "北京",
"g": {
"lng": "116.395645",
"lat": "39.929986"
}
},
{
@revolunet
revolunet / ffmpeg-tips.md
Last active October 6, 2023 17:47
ffmpeg tips

libcaca output from your OSX webcam

ffmpeg -f avfoundation -framerate 30 -s "640x480" -i "0" -c:v rawvideo -pix_fmt rgb24 -f caca -s "640x480" output4.mp4

brew install ffmpeg with options

brew install homebrew-ffmpeg/ffmpeg/ffmpeg --with-libcaca

convert to another format, resize withouth quality loss

ffmpeg -i vitrine.mp4 -vf scale=1024:-1 -q:vscale 0 vitrine.avi

@dannguyen
dannguyen / face-boxer-usage.md
Last active July 29, 2023 22:05
A face-detection script in Python

This face-boxer.py script is more-or-less the same code that you'll find in the OpenCV tutorial: Face Detection using Haar Cascades. For another variation, with more explanation, check out RealPython's tutorial.

Usage

The face-boxer.py script is designed to be run from the command-line. It has two required arugments:

  1. The path to a XML file containing a Haar-cascade of visual features. In this example, it will be the features that make up a face.
  2. The path to an image file that you want to perform face-detection on. You can pass in more than one image file as space-separated arguments.
@k4ml
k4ml / index.html
Last active May 15, 2024 09:23
PHP SSE Demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<script>
var source = new EventSource('updates.php');
source.onmessage = function(e) {
var updates;
/*
http://benjithian.sg/2012/12/simple-background-subtraction/
Simple Background Subtraction. Simple stuff.
*/
#include <stdio.h>
#include <curl/curl.h>
#include <sstream>
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
@davidwkeith
davidwkeith / index.html
Last active November 7, 2024 19:03
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom protocol handlers. Licensed under the WFTPL http://www.wtfpl.net/txt/copying/
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!--
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom
protocol handlers.