Skip to content

Instantly share code, notes, and snippets.

@harryhow
harryhow / PhysicsHelper.cs
Created March 27, 2022 14:51 — forked from ditzel/PhysicsHelper.cs
Unity Helper for Physic Functions
using UnityEngine;
namespace Ditzelgames
{
public static class PhysicsHelper
{
public static void ApplyForceToReachVelocity(Rigidbody rigidbody, Vector3 velocity, float force = 1, ForceMode mode = ForceMode.Force)
{
if (force == 0 || velocity.magnitude == 0)
Get-PnpDevice -FriendlyName *webcam*
Get-PnpDevice -FriendlyName *webcam* -Class Camera,image
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status OK).InstanceId
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status OK).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status Error).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status Error).InstanceId
@harryhow
harryhow / gpwebapi.py
Created January 29, 2021 19:36 — forked from kamoo1/gpwebapi.py
get complete review from google play store (>4400 limit)
import json
from enum import Enum
from utils.logging import get_logger
logger = get_logger(__name__)
class Pattern(Enum):
# OPTIONAL = 0
@harryhow
harryhow / AppReviews
Created January 29, 2021 19:08 — forked from kgn/AppReviews
App Reviews - Python script to retrieve App Store reviews and save them to a CSV file
#!/usr/bin/env python
try:
# For Python 3.0 and later
from urllib.request import urlopen
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen
import json
@harryhow
harryhow / file-upload-image-preview.markdown
Created February 2, 2020 19:25
File Upload & Image Preview
{"v":"5.4.2","fr":29.9700012207031,"ip":0,"op":37.0000015070409,"w":120,"h":50,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.602,"y":0.175},"o":{"x":0.686,"y":0},"n":"0p602_0p175_0p686_0","t":0,"s":[60,25.5,0],"e":[55,25.5,0],"to":[-0.41672024130821,0,0],"ti":[1.04180061817169,0,0]},{"i":{"x":0.334,"y":1},"o":{"x":0.367,"y":0.716},"n":"0p334_1_0p367_0p716","t":18,"s":[55,25.5,0],"e":[60,25.5,0],"to":[-1.04153263568878,0,0],"ti":[0.41661307215691,0,0]},{"t":36.0000014663101}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-24.75,-17.25],[-47.5,3],[-24.75,22],[-24.75,6.5],[50,6.5],[50,-3],[-24.75,-3]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":
{"v":"5.4.3","fr":29.9700012207031,"ip":0,"op":90.0000036657751,"w":750,"h":320,"nm":"新用户指引-03","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"形状图层 3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[375,160,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[42,9.75],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-354.5,-4.625],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90.0000036657751,"s
@harryhow
harryhow / gist:c9be133f8483c3ea24c17c17c72feb35
Created March 6, 2018 20:57
Where is my pyuic5 on mac with pycharm
harryhow@~/Users/harryhow/PycharmProjects/AGT_ShowControl/venv/bin/pyuic5 mainwindow.ui -o pyqtwindow.py
@harryhow
harryhow / gist:3959a1d34b73527aed14927c517bf6d9
Created December 28, 2017 08:17
List files without extension and output as a text file
ls -a | cut -d "." -f 1 > myTextFile.txt
ref: https://stackoverflow.com/a/37478734
@harryhow
harryhow / gist:829b902742e07fd1002f
Last active July 8, 2017 03:45
Regex validate for China's mobile number - update on Aug 2015
- (BOOL)validatePhoneChina:(NSString *)mobileNum
{
/**
* 手机号码
* 移动:134[0-8],135,136,137,138,139,147,150,151,152,157,158,159,178,182,183,184,187,188
* 联通:130,131,132,145,152,155,156,176,185,186
* 电信:133,1349,153,180,189,177
*/
//NSString * MOBILE = @"^1(3[0-9]|5[0-35-9]|8[025-9])\\d{8}$"; // TODO: can be removed, redundant
NSString * CM = @"^1(34[0-8]|(3[5-9]|47|5[0127-9]|78|8[23478])\\d)\\d{7}$";