Skip to content

Instantly share code, notes, and snippets.

View spartanatreyu's full-sized avatar
💭
The spice must flow and the stack must overflow

Jayden Pearse spartanatreyu

💭
The spice must flow and the stack must overflow
View GitHub Profile
@spartanatreyu
spartanatreyu / file.ts
Last active May 12, 2023 09:12
An example of using Capacitor v3's file APIs. This is using @capacitor/core: 3.0.1, and @capacitor/filesystem: 1.0.1.
import { Capacitor } from '@capacitor/core';
import { Filesystem, Directory, Encoding, WriteFileResult } from '@capacitor/filesystem';
// Basic file I/O functions
export const writeFile = async (path: string = 'secrets/text.txt', dataToWrite: string = 'hello world', isBinary: boolean = true) => {
return Filesystem.writeFile({
path: path,
data: dataToWrite,
directory: Directory.Data,
@spartanatreyu
spartanatreyu / typescript.json
Last active July 14, 2021 03:19
Personal vscode snippet for ts
{
// Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@spartanatreyu
spartanatreyu / javascript.json
Last active July 14, 2021 03:19
Personal vscode snippet for js
{
// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@spartanatreyu
spartanatreyu / karabiner.json
Created April 11, 2021 23:54
Personal Karabiner-elements config to set Caps+IJKL to arrows
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"jaydens_disabled_rules_to_be_experimented_with_later": [
@spartanatreyu
spartanatreyu / keybindings.json
Last active July 21, 2023 02:28
Personal vscode keybindings
// Place your key bindings in this file to overwrite the defaults
[
// Close window if trying to close a tab and there are not tabs left to close
{
"key": "cmd+w",
"command": "workbench.action.closeWindow",
"when": "!editorIsOpen && !multipleEditorGroups"
},
// Overwrite default tab switching shortcuts:
{
@spartanatreyu
spartanatreyu / settings.json
Last active November 29, 2023 07:04
Personal vscode settings.json
{
// Theme customisation
"workbench.colorTheme": "Monokai",
"editor.showFoldingControls": "always",
"editor.cursorSurroundingLines": 5,
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "all", //if you want it, check how it looks with rainbow-indent
"trailing-spaces.includeEmptyLines": false,
"trailing-spaces.highlightCurrentLine": false,
// "editor.guides.bracketPairs": "active", // Is only worth setting to true when files use one open bracket per indentation level
-------------------------------------------------------------------
--Hammerspoon config to replace Cinch & Size-up (Microsoft Windows style) window management for free
--By Jayden Pearse (spartanatreyu)
--Sort of messy, forgive me. Never scripted in lua before
-------------------------------------------------------------------
-------------------------------------------------------------------
--Options, feel free to edit these
-------------------------------------------------------------------
/* jshint devel: true */
/* global angular */
'use strict';
/*
Requres: https://github.com/dawsonloudon/VideoPlayer
Usage: <videoplayer src="videofile"></videoplayer>
Don't put ".mp4" or ".webm" in the src atr above
*/