Skip to content

Instantly share code, notes, and snippets.

@nathan130200
nathan130200 / CooldownVisualizer.cs
Created December 29, 2019 11:58
DSharpPlus: command cooldown visualizer using simple message update loop.
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using System.Threading;
@nathan130200
nathan130200 / getfiles.js
Last active October 3, 2019 15:19
Get all files from an path (w/recursive).
const fs = require("fs");
const path = require("path");
function getfiles(root, recursive)
{
var temp = fs.readdirSync(root);
var result = [];
for(const str of temp) {
try {
@nathan130200
nathan130200 / YoutubeSkipAd.user.js
Last active August 25, 2020 08:17
Automatic skip-ad and hide ad elements in youtube without use AD-Block, this script don't remove AD-Elements, just hide from page.
// ==UserScript==
// @name YoutubeSkipAd
// @version 1.6.3
// @description Automatic skip-ad and hide in youtube.
// @author FRNathan13
// @include /(http|https):\/\/www.youtube.com\/(.*)
// @grant none
// ==/UserScript==
(function() {
@nathan130200
nathan130200 / StreamHelper.cs
Created September 27, 2019 14:00
.NET Stream helper to read/write bytes.
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace System.IO
{
public static class StreamHelper
{
public static T Read<T>(this Stream stream, Func<byte[], int, T> converter)
where T : struct
@nathan130200
nathan130200 / ow cmd
Created September 16, 2019 10:26 — forked from Toyz/OW1 CMD
All command line options to Overwatch
----------POSSIBLE OPTIONS----------------------------------------------
--account : [optional] account name to login with
--key : [optional] connection key for the server (defaults to 1 in debug)
--automationRoutine : [optional] automation routine to run after login
--startAutomationGraph : [optional] start up and execute automation global graph using provided guid
--gatherEffectStats : [optional] enables effect stat gathering
--noautoconnect : [optional] Do not automatically connect to a server
--fastQuit
--dumpAssetNames : Write to <file> a JSON map of GUID (String "0xabc...") to asset name for all soft assets
--startPosition : [optional] start position when joining a map
@nathan130200
nathan130200 / DatabaseService.cs
Last active September 14, 2019 20:34
MongoDB Repository System
namespace WarfaceEmulator.Services
{
public class DatabaseService
{
public MongoClient Client { get; }
public IMongoDatabase Database { get; }
public DatabaseService()
{
this.Client = new MongoClient(new MongoClientSettings
@nathan130200
nathan130200 / ltx.d.ts
Last active August 4, 2019 15:35
node-xmpp-server typpings for typescript.
declare module 'ltx' {
import { EventEmitter } from "events";
export class Element {
name: String;
parent?: Element;
children: Array<Element>;
attrs: any;
constructor(name: String, attrs: any);
@nathan130200
nathan130200 / ApplicationAssetsDownloader.cs
Last active July 20, 2019 23:24
C# Discord application assets downloader using D#+. (produces a ZIP file with all assets files)
public delegate Task ApplicationAssetsDownloaderEventHandler(DiscordApplicationAsset asset);
class ApplicationAssetsDownloader : IDisposable
{
private ConcurrentQueue<DiscordApplicationAsset> _a;
private ZipArchive _ar;
private MemoryStream _ms;
public event ApplicationAssetsDownloaderEventHandler DownloadStartedAsync;
public event ApplicationAssetsDownloaderEventHandler DownloadCompletedAsync;
@nathan130200
nathan130200 / MessageBox.cs
Created July 14, 2019 18:39
C# user32.dll MessageBox Raw implementation without System.Windows.Forms (based on https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-messagebox)
namespace User32
{
public static class MessageBox
{
[DllImport("user32.dll")]
static extern int MessageBoxA(IntPtr hWnd,
string lpText,
string lpCaption,
uint uType);
@nathan130200
nathan130200 / DSharpPlusExtensions.cs
Last active July 14, 2019 15:41
Respond command context with dynamic embed creation.
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using DSharpPlus.CommandsNext;
using DSharpPlus.Entities;
namespace DSharpPlus
{