Skip to content

Instantly share code, notes, and snippets.

View woss's full-sized avatar
🛸

Daniel Maricic woss

🛸
View GitHub Profile
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
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
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 March 22, 2022 12:05 — forked from pepyakin/Dockerfile
Substrate Raspberry PI cross-compile build
# 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
BEGIN MESSAGE.
1eYirDxpAOKX9ds rl1OnjeYazalApH m0G4i0bHAFvQdv2 2QOmzieTMHLkjqi
flBA5wtRVZ7mEcN WsvIV6NVaOmTCKq 6Xr2MZHgg6tQkgj DHBfNlZB9TyhXbx
3WfxsKToqSnEmsY 2p2D8LsfT1eBp6H FXlJ1SEExKWkDyt I1zoESG34Ip2r4I
JcojqYXgYcB5dLR WqTZuNyqYbCUZOw 82YP.
END MESSAGE.
type OperationID = string
type OperationChild = [OperationID, [] | OperationChild[]]
interface Operation {
name: string,
ops: OperationChild[]
}
export async function lib() {
@woss
woss / vim.init.toml
Last active October 11, 2022 03:23
#=============================================================================
# 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 10:25
ESM __dirname and __filename
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 April 12, 2021 08:02
styled-components snowpack build with and without grommet
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 March 31, 2021 17:36
Simple plugin for injecting the precache files and setting up the local workbox files.
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