Skip to content

Instantly share code, notes, and snippets.

View scottheckel's full-sized avatar

Scott Heckel scottheckel

View GitHub Profile
@scottheckel
scottheckel / messagesbot.php
Created August 2, 2019 14:02
Neptune's Pride Message Discord Bot
<?php
require 'client.php';
// Discord Information
$discordApiUrl = 'https://discordapp.com/api/webhooks/INSERTYOURURL';
$discordBotName = 'leaderbot';
// Neptune's pride information
$alias = $_GET['username'];
$password = $_GET['password'];
@scottheckel
scottheckel / Long-form Multiplayer Strategy Games.md
Last active April 19, 2021 14:44
Long-form Multiplayer Strategy Games
@scottheckel
scottheckel / weapons.json
Last active September 20, 2017 19:27
Destiny 2 Data
{
"Weapons": [
{
"Name": "Nameless Midnight",
"Type": "Scout",
"Class": "Kinetic",
"Recommendations": [
{
"RiseOfBacon": "1"
}
@scottheckel
scottheckel / ZeroUtil.cs
Last active November 4, 2019 15:40
"Enterprise" Zero Checking in C#
/// <summary>
/// Utility for Zeroes
/// </summary>
public static class ZeroUtil
{
/// <summary>
/// A zero decimal
/// </summary>
public const decimal DecimalZero = 0.00000m;
@scottheckel
scottheckel / StubBaseExtensions.cs
Created June 6, 2017 21:14
Microsoft Fakes Stub Verify Method Called
public static class StubBaseExtensions
{
/// <summary>
/// Verify if a method was called on a stub
/// </summary>
/// <remarks>Derived from code found on http://www.peterprovost.org/blog/2012/11/29/visual-studio-2012-fakes-part-3/ </remarks>
/// <param name="stub">Stub</param>
/// <param name="methodName">Method Name</param>
/// <returns>True if <paramref name="methodName"/> was called</returns>
public static bool VerifyMethodCalled(this StubBase stub, string methodName)
@scottheckel
scottheckel / Brulean.cs
Last active February 25, 2016 20:33
yay/nay
public class Brulean
{
private string Value { get; set; } = "nay";
public static implicit operator bool(Brulean brul)
{
return brul.Value == "yay";
}
public static implicit operator Brulean(bool value)
@scottheckel
scottheckel / toggleled.cs
Created November 21, 2012 04:22
Simple Netduino Project – Toggle LED
using Microsoft.SPOT.Hardware;
using Netduino = SecretLabs.NETMF.Hardware.Netduino;
namespace ToggleLED
{
/// <summary>
/// Toggle the Netduino LED on/off based on a button press.
/// </summary>
public class Program
{
@scottheckel
scottheckel / parsehtmlwithcssandfizzlerex.cs
Created November 21, 2012 04:19
Parse HTML with CSS selectors using Fizzler and FizzlerEx
using Fizzler.Systems.HtmlAgilityPack;
using HtmlAgilityPack;
using System.Collections.Generic;
using System.Linq;
var web = new HtmlWeb();
var docNode = web.Load("http://dsc.discovery.com/tv-schedules/daily.html");
var shows =
from showRow in docNode.QuerySelectorAll("div.contentFrame tr")
select new
@scottheckel
scottheckel / yahoo_api_oauth_oob.cs
Created November 21, 2012 01:11
Yahoo API OAuth with OOB and Hammock
using Hammock;
using Hammock.Authentication.OAuth;
var credentials = new OAuthCredentials
{
ConsumerKey = "[INSERTKEY]",
SignatureMethod = OAuthSignatureMethod.HmacSha1,
ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
ConsumerSecret = "[INSERTSECRET]",
CallbackUrl = "oob"
@scottheckel
scottheckel / halochallenges.js
Created June 11, 2012 00:26
Halo Weekly/Daily Challenges
// Retrieve the Weekly and Daily Challenges for your user account on Halo.Xbox.com
// Written by Scott Heckel on June 10th, 2012
// Requires CasperJS (http://casperjs.org) to run
// Put your Microsoft Login here
var username = "yourusername";
var password = "yourpassword";
var casper = require('casper').create();
var fs = require('fs');