This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const vscode = require('vscode'); | |
/** | |
* マクロコンフィギュレーション(環境に合わせてお好みで設定) | |
*/ | |
module.exports.macroCommands = { | |
'カナ→ヘボン式ローマ字': { | |
no: 1, | |
func: toHepburn | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
amespace UserTempCleaner | |
{ | |
internal class Program | |
{ | |
// Threshold of elapsed time since the last use of the file/folder | |
private const int ELAPSED_HOURS = 168; | |
private static readonly string LOG_FILE = $"UserTempCleaner_{DateTime.Now:yyyyMMddHHmmss}.log"; | |
private static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License:MIT | |
// https://www.exceedsystem.net/2023/04/07/vscode-macros-macro-that-calls-chat-gpt-api-from-vscode | |
const vscode = require('vscode'); | |
const process = require('process'); | |
const { Configuration, OpenAIApi, OpenAI } = require('openai'); | |
// Completion API result class | |
class RunCompletionResult { | |
constructor(status, content, model, cost) { | |
this.status = status; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static class Extensions | |
{ | |
public static double StdDev(this IEnumerable<double> src) | |
{ | |
IList<double> lst = src is IList<double> ? (IList<double>)src : src.ToArray(); | |
int n = lst.Count(); | |
double ave = lst.Average(); | |
double s = 0; | |
for (int i = 0; i < n; ++i) | |
s = s + (lst[i] - ave) * (lst[i] - ave); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EXCEEDSYSTEM Sample of the XOR gate neural network with the TorchSharp | |
// https://www.exceedsystem.net/2022/09/12/how-to-implement-xor-gate-neural-network-with-torch-in-dotnet-6 | |
// License: MIT | |
using TorchSharp; | |
using static TorchSharp.torch; | |
using static TorchSharp.torch.nn; | |
using static TorchSharp.torch.nn.functional; | |
// Fix the random number seed to be used for weight and bias | |
torch.random.manual_seed(1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Firebase.Auth; | |
using Google.Apis.Auth.OAuth2; | |
using Google.Cloud.Firestore; | |
using Google.Cloud.Firestore.V1; | |
// Create a Firebase authentication provider with your Firebase project API key | |
var fbAuthProv = new FirebaseAuthProvider(new FirebaseConfig("{API key for your Firebase project}")); | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// EXCEEDSYSTEM EmoCheckUpdater | |
// https://www.exceedsystem.net/2022/05/26/how-to-update-emocheck-automatically | |
// License: MIT | |
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Json; | |
using System.Reflection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net6.0</TargetFramework> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
</PropertyGroup> | |
<ItemGroup> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [VSCode Macros] extension | |
// https://marketplace.visualstudio.com/items?itemName=EXCEEDSYSTEM.vscode-macros | |
// License:MIT | |
const vscode = require('vscode'); | |
const tsjsg = require('ts-json-schema-generator'); | |
const tmpp = require('tmp-promise'); | |
module.exports.macroCommands = { | |
TS2JsonSchema: { | |
no: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// License:MIT | |
local buttonNum = 4 -- Left small button is 3, Right small button is 4 | |
local scrolling = false | |
local scrollSteps = -2 -- When negative, it scrolls in reverse. | |
hooksMouseUp = hs.eventtap.new({hs.eventtap.event.types.otherMouseUp}, function(e) | |
if (e:getProperty(hs.eventtap.event.properties.mouseEventButtonNumber) == buttonNum and scrolling) then | |
scrolling = false | |
return true | |
end |
NewerOlder