Skip to content

Instantly share code, notes, and snippets.

View ms-gitpod.yml
image: woss/gitpod-workspace:gitpod_workspace-full_2022-05-08-14-31-53
tasks:
- name: prep env
before: >
pnpm add -g json @microsoft/rush@5.71.0
init: >
node common/scripts/install-run-rush.js update && exit
- name: Start mongodb container
command: cp dev-env .env && docker-compose up -d ipfs db && exit
View gitpod.yml
tasks:
- name: prep env
init: >
bash devops/install-deps.sh && cp env.sample .env && node common/scripts/install-run-rush.js update && exit
- name: Start mongodb container
command: docker-compose up -d ipfs db && exit
View getHashValue.ts
import { filter, isEmpty, split, startsWith } from 'ramda';
/**
* Parse the hash string and return the the value for the given name
* @param fullHash - The value of `$page.url.hash`
* @param hashName - Name of the hash which comes in `nam=value` format
* @returns decoded value via `decodeURIComponent`
*/
export function getHashValue(fullHash: string, hashName: string): string {
console.log('getHashValue', { hashName, fullHash });
@woss
woss / Dockerfile
Created Mar 22, 2022 — forked from pepyakin/Dockerfile
Substrate Raspberry PI cross-compile build
View Dockerfile
# Put this file in the root of substrate / polkadot directory and build the image using
# the following command:
#
# docker build -t <container id> .
#
# you can pick <container id> yourself. For example: `johndoe/rpi-cross`.
#
FROM rust:latest
View keys-pub-verification
BEGIN MESSAGE.
1eYirDxpAOKX9ds rl1OnjeYazalApH m0G4i0bHAFvQdv2 2QOmzieTMHLkjqi
flBA5wtRVZ7mEcN WsvIV6NVaOmTCKq 6Xr2MZHgg6tQkgj DHBfNlZB9TyhXbx
3WfxsKToqSnEmsY 2p2D8LsfT1eBp6H FXlJ1SEExKWkDyt I1zoESG34Ip2r4I
JcojqYXgYcB5dLR WqTZuNyqYbCUZOw 82YP.
END MESSAGE.
View operation.ts
type OperationID = string
type OperationChild = [OperationID, [] | OperationChild[]]
interface Operation {
name: string,
ops: OperationChild[]
}
export async function lib() {
View vim.init.toml
#=============================================================================
# dark_powered.toml --- dark powered configuration example for SpaceVim
# Copyright (c) 2016-2020 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================
# All SpaceVim option below [option] section
[options]
@woss
woss / esmDirname.ts
Created May 22, 2021
ESM __dirname and __filename
View esmDirname.ts
import { dirname } from 'path'
import esmFilename from './esmFilename'
/**
* ESM module helper for __dirname
* @example
* ``` typescript
* const __dirname = esmDirname(import.meta.url)
* ```
*/
@woss
woss / styled-components.browser.esm-8484d2d3.js
Last active Apr 12, 2021
styled-components snowpack build with and without grommet
View styled-components.browser.esm-8484d2d3.js
import {c as createCommonjsModule, r as react} from "./index-f0770002.js";
function defaultSetTimout() {
throw new Error("setTimeout has not been defined");
}
function defaultClearTimeout() {
throw new Error("clearTimeout has not been defined");
}
var cachedSetTimeout = defaultSetTimout;
var cachedClearTimeout = defaultClearTimeout;
var globalContext;
@woss
woss / snowpack-workbox-plugin.js
Created Mar 31, 2021
Simple plugin for injecting the precache files and setting up the local workbox files.
View snowpack-workbox-plugin.js
const { injectManifest, InjectManifestConfig, copyWorkboxLibraries } = require('workbox-build')
const rimraf = require('rimraf')
const { convertCompilerOptionsFromJson } = require('typescript')
const prependFile = require('prepend-file')
const { isNil } = require('ramda')
const { isEmpty } = require('ramda')
const { map } = require('ramda')
/**
* Injects the Manifest for the Service worker