Skip to content

Instantly share code, notes, and snippets.

https://lemmy.bolha.one/
https://o.opnxng.com/
# single instance mode #
https://old.lemmings.world/
https://old.kerala.party/
https://oldlemmy.justin.rs/
https://old.ttrpg.network/
https://old.lemmyonline.com/
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
rystaf / gotify.ps1
Last active December 7, 2021 08:58
Gotify notifications for Windows 10 using BurntToast https://github.com/Windos/BurntToast
param ($domain="p.domain.com", $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 {$_.id -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 (https://keybase.io/staffordr) on keybase.
  • I have a public key ASDbehNnMmgIKqqiHWKOB9KQVaJnI7Kyp-0Vf-XmvJ1tFAo

To claim this, I am signing this object:

@rystaf
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)=>{
sockets.push(socket)
socket.lastMsg = 0;
socket.name = 'anon'+n++
console.log(socket.name+' joined')
socket.write('Welcome '+socket.name+'! (Commands: /name /list)\n\r')
Comcast Agreement for Residential Services
ABOUT THIS AGREEMENT, OUR SERVICES, AND YOUR RIGHTS
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
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 https://developers.google.com/apps-script/guides/services/advanced#enabling_advanced_services 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
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
x = {};
$('#comments_list strong').each(
function(){
if(!x[this.innerHTML]) x[this.innerHTML] = 0;
x[this.innerHTML]++;
}
);
var t = [];
for (var g in x) t.push([g, x[g]]);
t.sort(function(a,b) {return b[1] - a[1]});
@rystaf
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'