Skip to content

Instantly share code, notes, and snippets.

View nberardi's full-sized avatar
😀

Nick Berardi nberardi

😀
View GitHub Profile
server version: 0.6.26
plugin version: @scrypted/webrtc 0.1.36
plugin loaded
[Test] remote options {
proxy: false,
offer: {
type: 'offer',
sdp: 'v=0\r\n' +
'o=- 3887398039 3887398039 IN IP4 0.0.0.0\r\n' +
's=a 2 z\r\n' +
@nberardi
nberardi / on-model-3-charging.json
Created March 6, 2023 15:08
Node Red - On Model 3 Charging Adjust Amperage From Car To Maximize Sun Without Grid Usage
[
{
"id": "d20b09cd596147aa",
"type": "tab",
"label": "On Model 3 charging",
"disabled": false,
"info": "",
"env": []
},
{
@nberardi
nberardi / FacebookGroupDelete.js
Created February 13, 2020 08:49
Allows you to delete all the members from a Facebook group, so that it can be removed.
var _memberMenus = document.getElementsByTagName('button');
var _confirmed = false;
var _i = 0;
var _f = 0;
var _resetAttempted = false;
var _waitCount = 0;
function clickMemberMenu() {
if (typeof(_memberMenus[_f]) !== 'undefined' && _memberMenus[_f].getAttribute('aria-label') == 'Member Settings') {
_resetAttempted = false;
@nberardi
nberardi / NSUrlSessionHandler.cs
Last active May 4, 2016 21:23
A rethinking of the NSUrlSessionHandler.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
@nberardi
nberardi / HomeController.cs
Created March 20, 2014 14:35
Example For Flushing Before Execution for Nik Molnar
public class HomeController : Controller {
public ActionResult Index () {
ViewBag.ExecuteAction = () => {
// do stuff here
return model;
};
return View();
}
}

Keybase proof

I hereby claim:

  • I am nberardi on github.
  • I am nberardi (https://keybase.io/nberardi) on keybase.
  • I have a public key whose fingerprint is 2404 DB48 5F66 9949 BECB A593 FFE7 811A CF75 F8CE

To claim this, I am signing this object:

public unsafe class NSDataStream : UnmanagedMemoryStream
{
public NSDataStream(NSData data)
: base((byte*)data.Bytes, data.Length)
{
_data = data;
}
private readonly NSData _data;
@nberardi
nberardi / executify.csx
Last active December 20, 2015 22:09
executify.csx
#r "System.Drawing.dll"
/*
* To use a GitHub Gist with Executify, you need to have a
* file named "executify.csx" in your Gist. Then you reference
* the Gist Identity in the Executify URL as
* http://executify.com/gist/{gist_id}
*/
using System.IO;
#r "System.Drawing.dll"
using System.IO;
using System.Drawing;
using System.Net;
var client = new WebClient();
var bytes = client.DownloadData("http://www.hdwallpapersplus.com/wp-content/uploads/2013/05/Funny-Cat-Pictures-cats-935656_500_375.jpg");
var stream = new MemoryStream(bytes);
var image = Image.FromStream(stream);
@nberardi
nberardi / Poker.cs
Last active September 25, 2020 13:12
Consensus: SignalR + TypeScript found here http://coderjournal.com/2013/07/signalr-and-typescript/
namespace Consensus.Hubs
{
public class Poker : Hub
{
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
private static Dictionary<string, PokerUser> _users = new Dictionary<string, PokerUser>();
private static List<PokerRoom> _rooms = new List<PokerRoom>();
public PokerUser Join(PokerUser user)