Skip to content

Instantly share code, notes, and snippets.

View trcio's full-sized avatar

patricio trcio

  • Texas
  • 15:57 (UTC -05:00)
View GitHub Profile
@trcio
trcio / instructions.md
Created February 10, 2021 06:01 — forked from richlander/instructions.md
Installing .NET Core 3.0 on Linux ARM64

Installing .NET Core on Linux ARM64

The following intructions can be used to install .NET Core on Linux ARM64.

Pro tip: Check out .NET Core Docker files to determine the exact instructions for installing .NET Core builds, for example .NET Core 3.1 ARM32 SDK Dockerfile.

Installing .NET Core Globally

The following instructions install the latest .NET Core globally. It isn't required to do that, but it provides the best experience.

@trcio
trcio / CLIParserAndTokenizer.cpp
Last active February 16, 2019 03:44
SE 3377 CLI Parser and Tokenizer
#include <iostream>
#include <iomanip>
#include <list>
#include <stack>
#include <string>
using namespace std;
enum class TokenType
{
@trcio
trcio / NetsealProvider.php
Last active January 31, 2017 12:02
Scroll all the way down for an example - A wrapper for Netseal's new v2 API - http://seal.nimoru.com/docs/index.php
<?php
// Created by Positron Software
// Wraps all endpoints described at http://seal.nimoru.com/docs/index.php
// Last updated 11/23/2016
class NetsealProvider
{
const ENDPOINT = 'http://seal.nimoru.com/Remote2/';
@trcio
trcio / TablessControl.cs
Created November 12, 2015 04:03
Hide your tab selectors at runtime
class TablessControl : TabControl
{
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x1328 && !DesignMode)
m.Result = new IntPtr(1);
else
base.WndProc(ref m);
}
}
@trcio
trcio / ColorExtensions.cs
Created November 10, 2015 01:04
Saturate a color through an extension
public static class ColorExtensions
{
public static Color Saturate(this Color color, float coef)
{
return Color.FromArgb((int)(color.R * coef), (int)(color.G * coef), (int)(color.B * coef));
}
}
@trcio
trcio / SoundcloudBars.cs
Created September 6, 2015 17:15
Soundcloud music bars on the mobile app
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Timer = System.Timers.Timer;
public sealed class SoundcloudBars : Control
{
private readonly Timer AnimationTimer;
private readonly List<Bar> Bars;
@trcio
trcio / LineGraph.cs
Last active January 7, 2018 07:20
A really nice looking line graph to present your data
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Globalization;
using System.Linq;
using System.Windows.Forms;
public sealed class LineGraph : Control
{
@trcio
trcio / NetsealProvider.php
Last active July 21, 2016 01:18
Netseal's PHP wrapper is dreadful, so I remade it
<?php
class NetsealProvider {
const ENDPOINT = 'http://seal.nimoru.com/';
const LICENSE_FREE = 0;
const LICENSE_BRONZE = 1;
const LICENSE_SILVER = 2;
const LICENSE_GOLD = 3;
const LICENSE_PLATINUM = 4;
@trcio
trcio / ChangeCalculator.cs
Last active August 29, 2015 14:22
Finding the least amount of bills/coins for any monetary value (using common bills/coins, no $2 bill, 50 cent coin, etc)
public class ChangeCalculator
{
public static Dictionary<decimal, decimal> GetUsdChange(decimal dollars)
{
return GetChange(dollars, new[] {100, 50, 20, 10, 5, 1, .25M, .10M, .05M, .01M});
}
public static Dictionary<decimal, decimal> GetChange(decimal amount, IEnumerable<decimal> denominations)
{
denominations = denominations.OrderByDescending(i => i);
@trcio
trcio / OpticCdn.cs
Last active August 29, 2015 14:17
A simple bypass of opticcdn protection, set the cookie "optic_auth" to the value the method returns (returns null on failure)
public static string GetOpticCdnCookie(string source)
{
var matches = Regex.Matches(source, "var .* = \"(.*)\"");
if (matches.Count != 10) return null;
var combined = string.Concat(matches[0].Groups[1].Value, matches[1].Groups[1].Value,
matches[2].Groups[1].Value, matches[3].Groups[1].Value, matches[8].Groups[1].Value,
matches[9].Groups[1].Value, matches[4].Groups[1].Value, matches[5].Groups[1].Value,
matches[6].Groups[1].Value, matches[7].Groups[1].Value);
using (var sha = new SHA1Managed())
{