Skip to content

Instantly share code, notes, and snippets.
# single instance mode #
const fs = require('fs')
const https = require('https')
const querystring = require('querystring')
const ord = (i) => {
const j = i % 10,
k = i % 100;
if (j == 1 && k != 11) return i + "st";
if (j == 2 && k != 12) return i + "nd";
if (j == 3 && k != 13) return i + "rd";
return i + "th";
rystaf / gotify.ps1
Last active December 7, 2021 08:58
Gotify notifications for Windows 10 using BurntToast
param ($domain="", $token="AAAAAAAA")
wscat -c "wss://$domain/stream?token=$token" | %{ convertfrom-json $_ } | where-object {$_.message.length -gt 0} |
$appid = $_.appid
$icon = iwr https://$domain/application?token=$token |
%{ (convertfrom-json $_.content) } | where-object {$ -eq $appid} | select -expandproperty image
new-burnttoastnotification -applogo https://$domain/$icon -Text $_.title, $_.message

Keybase proof

I hereby claim:

  • I am rystaf on github.
  • I am staffordr ( on keybase.
  • I have a public key ASDbehNnMmgIKqqiHWKOB9KQVaJnI7Kyp-0Vf-XmvJ1tFAo

To claim this, I am signing this object:

rystaf / server.js
Last active August 27, 2017 21:31
chat server
var net = require('net')
var sockets = [];
var n = 0
var server = net.Server((socket)=>{
socket.lastMsg = 0; = 'anon'+n++
console.log(' joined')
socket.write('Welcome ''! (Commands: /name /list)\n\r')
Comcast Agreement for Residential Services
XFINITY® Service(s) will be provided to you (“you,” “your,” or “Customer”) on the terms and conditions set forth in this Agreement for Residential Services (the “Agreement”) and applicable law by the operating company subsidiary or affiliate of Comcast Cable Communications, LLC that (i) owns and/or operates the cable television system in your area and/or (ii) the subsidiary that is the XFINITY Digital Voice service provider (“Comcast,” “we,” “us,” or “our”). For purposes of this Agreement, “affiliate” means any entity that controls, is controlled by or is under common control with Comcast Cable Communications, LLC. Service(s) may include, but are not limited to, XFINITY TV cable television service (“XFINITY Video”), XFINITY Internet service including XFINITY WiFi (“XFINITY Internet”), and XFINITY Voice (herein collectively “XFINITY Voice”) (each a “Service” and collectively the “Services”). The Service(s) do not in
rystaf / convertExcel2Sheets
Created April 7, 2017 16:22 — forked from azadisaryev/convertExcel2Sheets
Google Apps Script for converting Excel (.xls or .xlsx) file to Google Spreadsheet. Drive API must be enabled in your script's Advanced Google Services and in Developers Console for the script to work (see for details).
* Convert Excel file to Sheets
* @param {Blob} excelFile The Excel file blob data; Required
* @param {String} filename File name on uploading drive; Required
* @param {Array} arrParents Array of folder ids to put converted file in; Optional, will default to Drive root folder
* @return {Spreadsheet} Converted Google Spreadsheet instance
function convertExcel2Sheets(excelFile, filename, arrParents) {
var parents = arrParents || []; // check if optional arrParents argument was provided, default to empty array if not
rystaf / Dockerfile
Last active August 29, 2016 18:38
snipeit build
FROM snipe/snipe-it
RUN cp /var/www/html/docker/app.php /var/www/html/app/config/production/app.php
RUN cp /var/www/html/docker/database.php /var/www/html/app/config/production/app.php
rystaf / .vimrc
Last active August 29, 2015 14:13
filetype off
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'jellybeans.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'nginx.vim'
rystaf / gist:c4ee2705c52ee8be48ae
Last active August 29, 2015 14:07
445.1574 Prohibited conduct by manufacturer.
Sec. 14.
(1) A manufacturer shall not do any of the following:
(a) Adopt, change, establish, or implement a plan or system for the allocation and distribution of new motor vehicles to new motor vehicle dealers that is arbitrary or capricious or based on unreasonable sales and service standards, or modify an existing plan or system that causes the plan or system to be arbitrary or capricious or based on unreasonable sales and service standards.
(b) If requested in writing by a new motor vehicle dealer, fail or refuse to advise or disclose to the dealer the basis on which new motor vehicles of the same line make are allocated or distributed to new motor vehicle dealers in this state and the basis on which the current allocation or distribution is being made or will be made to that new motor vehicle dealer.
(c) Refuse to deliver to a new motor vehicle dealer in reasonable quantities and within a reasonable time after receipt of the dealer’s order, any new motor vehicles that are covered by the dealer agreem