Skip to content

Instantly share code, notes, and snippets.

Avatar

nothingismagick

View GitHub Profile
@nothingismagick
nothingismagick / index.html
Created Jun 29, 2021
Minimal Tauri "read public key" translation from Electron Sample
View index.html
<html>
<head>
<script type="module">
import { invoke } from './@tauri-apps/api/tauri.js'; // just copied from node_modules
function getPubkey() {
return invoke("show_pubkey").then((message) => message);
}
document.getElementById("clicky").addEventListener("click", async function () {
document.getElementById("key").innerHTML = await getPubkey();
View Shots
HANDLUNG
getranke hoffman
SAMSTAG
Einkaufen
- schnelltests
- handschuhe
- external battery
View GH Activity Feed
❗️ Closed issue #48 in iotaledger/stronghold.rs
🗣 Commented on #48 in iotaledger/stronghold.rs
❗️ Opened issue #74 in iotaledger/chronicle.rs
🗣 Commented on #135 in tauri-apps/tauri-docs
🎉 Merged PR #1024 in tauri-apps/tauri
We couldn’t find that file to show.
@nothingismagick
nothingismagick / post-commit
Last active Mar 11, 2019 — forked from danmichaelo/post-commit
Git post-commit: update api docs on gh-pages branch for GitHub Pages
View post-commit
#!/usr/bin/env bash
###
### The following block runs after commit to "master" branch
###
if [ `git rev-parse --abbrev-ref HEAD` == "master" ]; then
echo
echo "Updating API documentation at the gh-pages branch..."
echo
@nothingismagick
nothingismagick / jest-loader.js
Created Dec 4, 2018
<test lang="jest"> template loader for Vue SFC
View jest-loader.js
const fs = require('fs')
const loaderUtils = require('loader-utils')
const path = require('path')
module.exports = function (source) {
const options = loaderUtils.getOptions(this)
const filename = path.parse(this.resourcePath).name
const extension = (options && options.extension) || '_jest.spec.js'
@nothingismagick
nothingismagick / ts-quasar-cli.md
Created Nov 16, 2018 — forked from snowyu/ts-quasar-cli.md
Add the typescript supports to quasar framework
View ts-quasar-cli.md

Note: This guide applies to the project created by quasar-cli.

First install typescript and ts-loaderpackages in your project.

npm i -D typescript ts-loader

Then modified the quasar.conf.js file in your project:

@nothingismagick
nothingismagick / caret.js
Last active Sep 15, 2021
Small script to detect caret pixel position in contenteditable div
View caret.js
/**
* Get the caret position in all cases
*
* @returns {object} left, top distance in pixels
*/
getCaretTopPoint () {
const sel = document.getSelection()
const r = sel.getRangeAt(0)
let rect
let r2
View Description.md

So you want to use ENV vars. Good on you. Here is a quick snippet to help you manage that.

/config/index.js

module.exports = {
  NODE_ENV: 'development',
  FOO: 'bar'
}