Skip to content

Instantly share code, notes, and snippets.

View ExpandOcean's full-sized avatar

Zhang Yang ExpandOcean

  • Shanghai, China
View GitHub Profile
@MoyuScript
MoyuScript / 压缩脚本.sh
Last active October 12, 2024 06:58
字体压缩
#!/bin/bash
# MIT License
# Copyright (c) 2022-present MoyuScript
# See: https://mit-license.org/
echo "Input path: $1"
echo "With subset: $2"
echo "Custom text file: $3"
@sonnylazuardi
sonnylazuardi / code.ts
Created June 11, 2021 04:27
Resizable Figma Plugin Window
figma.showUI(__html__,{width: 250, height: 250});
// restore previous size
figma.clientStorage.getAsync('size').then(size => {
if(size) figma.ui.resize(size.w,size.h);
}).catch(err=>{});
figma.ui.onmessage = msg => {
switch (msg.type) {
case "resize":
figma.ui.resize(msg.size.w,msg.size.h);
figma.clientStorage.setAsync('size', msg.size).catch(err=>{});// save size
@jose-mdz
jose-mdz / README.md
Last active October 12, 2024 23:08
Orthogonal Diagram Connector

Orthogonal Connectors

This algorithm returns the points that form an orthogonal path between two rectangles.

How to Use

// Define shapes
const shapeA = {left: 50,  top: 50, width: 100, height: 100};
const shapeB = {left: 200, top: 200, width: 50, height: 100};
@jose-mdz
jose-mdz / README.md
Last active June 23, 2024 08:04
Draw round corners path in JavaScript

Round Corner Path

[x] Tested

Usage

const canvas = document.getElementById('myCanvas');
const context = canvas.getContext('2d');
const points = [
 {x: 100, y: 100},
@X-Raym
X-Raym / DaVinci Resolve Scripting Doc.txt
Last active November 13, 2024 02:53
DaVinci Resolve Scripting API Doc v19.1
Last Updated: 28 October 2024
-----------------------------
In this package, you will find a brief introduction to the Scripting API for DaVinci Resolve Studio. Apart from this README.txt file, this package contains folders containing the basic import
modules for scripting access (DaVinciResolve.py) and some representative examples.
From v16.2.0 onwards, the nodeIndex parameters accepted by SetLUT() and SetCDL() are 1-based instead of 0-based, i.e. 1 <= nodeIndex <= total number of nodes.
Overview
--------
As with Blackmagic Fusion scripts, user scripts written in Lua and Python programming languages are supported. By default, scripts can be invoked from the Console window in the Fusion page,
@Shreeyak
Shreeyak / create_pointCloud.py
Created May 2, 2019 10:23
Script to create a point cloud and save to .ply file from an RGB and Depth Image
#!/usr/bin/env python3
import numpy as np
from PIL import Image
import imageio
import OpenEXR
import struct
import os
def get_pointcloud(color_image,depth_image,camera_intrinsics):
@rigwild
rigwild / aes.js
Last active April 28, 2024 12:47
Easily encrypt string or object using Crypto-JS AES encryption
'use strict'
const password = 'secure secret key'
const encrypt = (content, password) => CryptoJS.AES.encrypt(JSON.stringify({ content }), password).toString()
const decrypt = (crypted, password) => JSON.parse(CryptoJS.AES.decrypt(crypted, password).toString(CryptoJS.enc.Utf8)).content
// Encrypt
const encryptedString = encrypt('This is a string', password)
const encryptedObject = encrypt({ test: 'This is an object' }, password)
@artizirk
artizirk / 01-video.py
Last active November 22, 2022 11:48
Python v4l2 webcam capture test using PlayStation 3 camera. More advanced script can be found here: https://github.com/eik-robo/zoidberg/blob/master/examples/purepy_video_capture.py
#!/usr/bin/env python3
from v4l2 import *
import fcntl
import mmap
import select
import time
vd = open('/dev/video0', 'rb+', buffering=0)
@marians
marians / CouchDB_Python.md
Last active September 1, 2024 00:19
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@jfmengels
jfmengels / lodash-fp-documentation.md
Last active July 25, 2024 05:02
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs