Skip to content

Instantly share code, notes, and snippets.

@bryanwood
bryanwood / Program.cs
Created January 12, 2023 06:44
Document Service Example
using System;
using System.Collections.Generic;
using System.Linq;
IDocumentService service = new DocumentService();
var context = new AuthContext { UserId = "123abc" };
var anotherContext = new AuthContext { UserId = "456def" };
var id = service.CreateDocument(context, "test document");
@bryanwood
bryanwood / pjax.js
Last active December 6, 2017 14:14
const ContentSelectors = [".content"];
// clear a node of all its children
function empty(node) {
while (node.firstChild) {
node.removeChild(node.firstChild);
}
}
// delay for approximately X milliseconds
@bryanwood
bryanwood / paket.ps1
Last active November 22, 2015 05:49
grab paket.bootstrapper.exe then init
@powershell -NoProfile -Command "&{New-Item -ItemType directory -Path .paket -ErrorAction Ignore ; Invoke-WebRequest (Invoke-WebRequest https://api.github.com/repos/fsprojects/paket/releases/latest | ConvertFrom-Json | Select-Object -ExpandProperty assets | Where-Object {$_.name -eq 'paket.bootstrapper.exe' }).browser_download_url -OutFile .\.paket\paket.bootstrapper.exe ; .\.paket\paket.bootstrapper.exe ; .\.paket\paket.exe init}"
@bryanwood
bryanwood / Program.cs
Created September 16, 2014 00:26
Ping Meter
using System;
using System.Threading;
namespace Suping
{
class Program
{
static void Main(string[] args)
{
var port = new System.IO.Ports.SerialPort("COM3", 57600);
@bryanwood
bryanwood / Program.cs
Created March 7, 2014 06:11
HttpClient with handler for testing
using System;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApplication11
{
class Program
{
// ==UserScript==
// @name JabbR: Admin Kick Banned Users
// @namespace http://jabbr.net.admin/
// @version 0.1
// @description Kick mother bitches from JabbR who have been a pesk.
// @match https://jabbr.net/*
// @copyright 2013+, JabbR people
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==