Skip to content

Instantly share code, notes, and snippets.

View exceedsystem's full-sized avatar

Y.Sakamoto exceedsystem

View GitHub Profile
@exceedsystem
exceedsystem / index.html
Created October 31, 2021 22:13
An Example of how to show context-menu in Electron
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Electron Context Menu Sample</title>
</head>
<body>
<script>
@exceedsystem
exceedsystem / index.html
Created October 31, 2021 04:26
Electron ContextMenu Issue 1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Electron Context Menu Test</title>
</head>
<body>
<script>
@exceedsystem
exceedsystem / simple_totp_client.cs
Last active October 18, 2023 16:35
A simple example of implementing TOTP in C#
// https://www.exceedsystem.net/2021/10/04/how-to-implement-otp-in-csharp-so-easy/
// License:MIT
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Threading;
namespace _2FAS
@exceedsystem
exceedsystem / Program.cs
Last active October 18, 2021 19:55
Use surfshark vpn from linux other than ubuntu and debian
// https://www.exceedsystem.net/2021/10/02/how-to-use-surfshark-vpn-from-linux-other-than-ubuntu-and-debian/
// License:MIT
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
namespace SurfsharkConnector
{
@exceedsystem
exceedsystem / list-files.js
Created September 28, 2021 12:19
An example of 'Show file list' macro for VSCodeMacros extension
// [VSCode Macros] extension
// https://marketplace.visualstudio.com/items?itemName=EXCEEDSYSTEM.vscode-macros
// License:MIT
const vscode = require('vscode');
const fs = require('fs');
const path = require('path');
/**
* Macro configuration settings
* { [name: string]: { ... Name of the macro
@exceedsystem
exceedsystem / tsv2sql.js
Created August 24, 2021 13:05
An example of 'Convert TSV to SQL Insert statement' macro for VSCodeMacros extension
// [VSCode Macros] extension
// https://marketplace.visualstudio.com/items?itemName=EXCEEDSYSTEM.vscode-macros
// License:MIT
const vscode = require('vscode');
/**
* Macro configuration settings
* { [name: string]: { ... Name of the macro
* no: number, ... Order of the macro
* func: ()=> string | undefined ... Name of the body of the macro function
@exceedsystem
exceedsystem / json2tsv.js
Last active July 3, 2022 23:03
An example of 'Convert JSON array to TSV' macro for VSCodeMacros extension
// [VSCode Macros] extension
// https://marketplace.visualstudio.com/items?itemName=EXCEEDSYSTEM.vscode-macros
// License:MIT
const vscode = require('vscode');
/**
* Macro configuration settings
* { [name: string]: { ... Name of the macro
* no: number, ... Order of the macro
* func: ()=> string | undefined ... Name of the body of the macro function
@exceedsystem
exceedsystem / sql-formatter.js
Created June 4, 2021 11:28
An example of 'Format selected SQL' macro for VSCodeMacros extension
// [VSCode Macros] extension
// https://marketplace.visualstudio.com/items?itemName=EXCEEDSYSTEM.vscode-macros
// License:MIT
const vscode = require('vscode');
const formatter = require('sql-formatter');
/**
* Macro configuration
*/
module.exports.macroCommands = {
@exceedsystem
exceedsystem / CheckES.js
Last active July 3, 2022 23:03
An example of 'Check ES version' macro for VSCodeMacros extension
// [VSCode Macros] extension
// https://marketplace.visualstudio.com/items?itemName=EXCEEDSYSTEM.vscode-macros
// License:MIT
const vscode = require('vscode');
const acorn = require('acorn');
/**
* Macro configuration
*/
module.exports.macroCommands = {
@exceedsystem
exceedsystem / MarkdownFormatter.js
Last active July 3, 2022 23:04
An example of 'Markdown formatter' macro for VSCodeMacros extension
// [VSCode Macros] extension
// https://marketplace.visualstudio.com/items?itemName=EXCEEDSYSTEM.vscode-macros
// License:MIT
const vscode = require('vscode');
const remark = require('remark'); // Requires version 13 or above
const remarkParse = require('remark-parse');
const remarkStringify = require('remark-stringify');
const remarkGFM = require('remark-gfm');
const remarkFrontmatter = require('remark-frontmatter'); // Requires version 3 or above