How to run examples:
- Run $ createdb nplusonedb to create DB
- Run specs $ rspec demo.rb
| # Generate ed25519 privkey | |
| openssl genpkey -algorithm ed25519 -out privkey.pem | |
| # export its pubkey | |
| openssl pkey -in privkey.pem -pubout -out pubkey.pem | |
| # Generate RSA privkey | |
| openssl genrsa -des3 -out private.pem 2048 | |
| # export its pubkey | |
| openssl rsa -in private.pem -outform PEM -pubout -out public.pem |
How to run examples:
| import * as React from "react"; | |
| import { useMousePosition } from "~/hooks/useMousePosition"; | |
| /** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */ | |
| export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) { | |
| const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {}; | |
| const [mouseX, mouseY] = useMousePosition(); | |
| const positions = { x, y, h, w, mouseX, mouseY }; | |
| return ( | |
| <div |
| const fetch = require('node-fetch'); | |
| async function run() { | |
| let username = "YOUR USERNAME HERE"; | |
| let password = "YOUR APP PASSWORD"; | |
| let authBasic = new Buffer(username + ':' + password).toString('base64'); | |
| let session = await (await fetch('https://jmap.fastmail.com/.well-known/jmap', { | |
| headers: { | |
| "Authorization": "Basic " + authBasic | |
| } | |
| })).json(); |
| const typeOf = (value) => | |
| ({}.toString | |
| .call(value) | |
| .match(/\s([a-zA-Z]+)/)[1] | |
| .toLowerCase()); | |
| export default typeOf; |
| #define _POSIX_C_SOURCE 199309L | |
| //#define DEBUG | |
| #include <Imlib2.h> | |
| #include <X11/Xatom.h> | |
| #include <X11/Xlib.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <time.h> |
| #!/bin/sh | |
| FILES=$(deno fmt) | |
| if [ -n "$FILES" ]; then | |
| echo "formatted, adding files $FILES" | |
| echo "$FILES" | xargs git add | |
| fi | |
| exit 0 |
| import SwiftUI | |
| import PlaygroundSupport | |
| // NOTE: this example currently only works with US-based coordinates | |
| // constants | |
| // New York | |
| let latitude = 40.709335 | |
| let longitude = -73.956558 |
| import SwiftUI | |
| import PlaygroundSupport | |
| struct Desktop: View { | |
| var body: some View { | |
| ZStack { | |
| // Image(uiImage: #imageLiteral(resourceName: "IMG_6281.JPG")) | |
| Color(UIColor.systemBlue) | |
| macOS() | |
| } |
Upgrade nodejs to v12.x.x
$ sudo npm install -g n
$ sudo n lts
Install hsd