Skip to content

Instantly share code, notes, and snippets.

View weilinzung's full-sized avatar

Wei weilinzung

  • Canada
View GitHub Profile
@Ashung
Ashung / code.js
Last active March 31, 2024 04:52
Figma Snippets
let layer = figma.currentPage.selection[0];
let vectorPaths = layer.vectorPaths.map(item => {
return {windingRule: 'NONZERO', data: item.data}
})
layer.vectorPaths = vectorPaths
layer.exportAsync({
format: 'SVG'
}).then(uint8Array => {
import { GCS_BUCKET_NAME_MEDIA } from '../config/storage';
import { MediaGenerateThumbsOnWrite } from './media-thumbs.function';
import { ObjectMetadata } from 'firebase-functions/lib/providers/storage';
import { ObjectWritableMock } from 'stream-mock';
import { DownloadResponse } from '@google-cloud/storage';
// tslint:disable-next-line
const { Storage } = require('@google-cloud/storage');
jest.mock('@google-cloud/storage');
@soberich
soberich / bulk_clone_bitbucket.sh
Created April 30, 2020 18:54
Bulk clone repos in Bitbucket REST Api 2.0
# prerequisites: `httpie`, `jq`, GNU's `parallel`. e.g. brew install <package>
# there is max 100 page length n pages where n is 100 length page. Execute one one by one (there is no way you'll get more than 100 times parallelization)
# in `.values[].links.clone[1].href` `1` is for SSH, where `0` would be for HTTPS.
http https://<user>:<pass>@api.bitbucket.org/2.0/repositories/<account_name> pagelen==100 page==<page_num> | jq -r '.values[].links.clone[1].href' | parallel git clone
# Voila it takes approx 1-2 minutes to clone a 100 repos.
@br3ndonland
br3ndonland / github-actions-notes.md
Last active August 11, 2025 07:34
Getting the Gist of GitHub Actions
@cecilemuller
cecilemuller / example.yml
Created October 20, 2020 01:49
Run Docker Compose + in Github Action
name: Test
on:
push:
branches:
- main
- features/**
- dependabot/**
pull_request:
branches:
@sindresorhus
sindresorhus / esm-package.md
Last active August 13, 2025 20:49
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.