Steps to get Capacitor working with SvelteKit
- Set up a SvelteKit project as usual.
npm create svelte@latest my-app
cd my-app
npm install
npm run dev -- --open
import { writable, type Updater, type Writable } from 'svelte/store'; | |
/** | |
* Create a writable store that persists to sessionStorage or localStorage. | |
* | |
* Usage example: | |
* export const colorScheme = createPersistentWritable<'system' | 'dark' | 'light'>({ storageId: 'color-scheme', useLocalStorage: true }, 'dark'); | |
*/ | |
export function createPersistentWritable<T>( | |
{ storageId, useLocalStorage }: { storageId: string; useLocalStorage?: boolean }, |
// THREEjs build-in uniforms and attributes (Fragment) | |
// uniform mat4 viewMatrix - camera.matrixWorldInverse | |
// uniform vec3 cameraPosition - camera position in world space | |
varying vec2 vUv; | |
uniform sampler2D albedo; | |
void main() { |
const Avatar = ({ profile, ...props }) => ( | |
<img | |
className="avatar" | |
src={profile && profile.photoUrl} | |
alt={profile && profile.photoAlt} | |
{...props} | |
/> | |
); | |
Avatar.propTypes = { |
#!/bin/bash | |
# Copyright © 2017 Google Inc. | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
/** | |
* @author richt / http://richt.me | |
* @author WestLangley / http://github.com/WestLangley | |
* | |
* W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html) | |
*/ | |
THREE.DeviceOrientationControls = function( object ) { | |
var scope = this; |
autocomplete="off"
onto <form>
element;<input>
with autocomplete="false"
as a first children element of the form.<form autocomplete="off" method="post" action="">
<input autocomplete="false" name="hidden" type="text" style="display:none;">
...
var concat = require("concat-stream"); | |
var hyperquest = require("hyperquest"); | |
var Promise = require("bluebird"); | |
var stream = require("stream"); | |
// Wait for the request to finish or fail | |
function promisify(req) { | |
return new Promise(function (resolve, reject) { | |
req.on("error", reject).pipe(concat({ encoding: "string" }, resolve)); |
These instructions will guide you through the process of setting up local, trusted websites on your own computer.
These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.
NOTE: You may substitute the edit
command for nano
, vim
, or whatever the editor of your choice is. Personally, I forward the edit
command to Sublime Text:
alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"