Skip to content

Instantly share code, notes, and snippets.

View rebornix's full-sized avatar
📓
Working from home

Peng Lyu rebornix

📓
Working from home
View GitHub Profile
@rebornix
rebornix / content.swift
Created December 22, 2019 06:21
SwiftUI list view selection & navigation
import SwiftUI
struct Task: Codable, Identifiable, Hashable {
var id: Int
var name: String
}
struct ContentView: View {
@rebornix
rebornix / extension.ts
Last active April 10, 2020 18:24
Powershell Notebook
import * as vscode from 'vscode';
class PSNB implements vscode.NotebookProvider {
constructor() {}
async resolveNotebook(editor: vscode.NotebookEditor): Promise<void> {
editor.document.languages = ['powershell'];
const uri = editor.document.uri;
const data = (await vscode.workspace.fs.readFile(uri)).toString();
const lines = data.split(/\r|\n|\r\n/g);