Skip to content

Instantly share code, notes, and snippets.

Heiswayi Nrird heiswayi

Block or report user

Report or block heiswayi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
heiswayi / LargestTriangleThreeBuckets.cs
Created Aug 22, 2019 — forked from DanielWJudge/LargestTriangleThreeBuckets.cs
Largest-Triangle-Three Bucket Downsampling Graphs in C#
View LargestTriangleThreeBuckets.cs
public static IEnumerable<Tuple<double, double>> LargestTriangleThreeBuckets(List<Tuple<double, double>> data, int threshold)
int dataLength = data.Count;
if (threshold >= dataLength || threshold == 0)
return data; // Nothing to do
List<Tuple<double, double>> sampled = new List<Tuple<double, double>>(threshold);
// Bucket size. Leave room for start and end data points
double every = (double)(dataLength - 2) / (threshold - 2);
heiswayi / TextBoxMaskBehavior.cs
Created Nov 3, 2018
WPF utilities: TextBox masking
View TextBoxMaskBehavior.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Globalization;
namespace WpfUtilities
public class TextBoxMaskBehavior
#region MinimumValue Property
heiswayi / EncryptDecrypt.cs
Created Aug 24, 2018
Encryption & Decryption method for C#
View EncryptDecrypt.cs
public static string Encrypt(string data, string key)
RijndaelManaged rijndaelCipher = new RijndaelManaged();
rijndaelCipher.Mode = CipherMode.CBC;
rijndaelCipher.Padding = PaddingMode.PKCS7;
rijndaelCipher.KeySize = 0x80;
rijndaelCipher.BlockSize = 0x80;
byte[] pwdBytes = Encoding.UTF8.GetBytes(key);
byte[] keyBytes = new byte[0x10];
heiswayi / copyToGitHub.bat
Last active Aug 2, 2018
Batch scripting to copy compiled Jekyll source into GitHub repo, but first delete previous folders and files
View copyToGitHub.bat
@echo off
set from="G:\GIT-REPOS\MyBitBucket\\_site"
set to="G:\GIT-REPOS\MyGitHub\"
for %%i in (%to%\*) do (
del /S /Q %%i
for /d %%i in (%to%\*) do (
heiswayi / zipper.php
Created Jul 20, 2018
Example of PHP script I used to zip a folder and then force download the zipped file when this script is visited thru web browser
View zipper.php
$dir = 'inescov1';
$zip_file = '';
// Get real path for our folder
$rootPath = realpath($dir);
// Initialize archive object
$zip = new ZipArchive();
heiswayi /
Created Jun 3, 2018
Generic desktop app EULA sample


This End-User License Agreement (EULA) is a legal agreement between you (either as an individual or on behalf of an entity) and [[AUTHOR]] regarding your use of [[APPNAME]]'s desktop applications, and associated documentation (the "Software"). IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS EULA, DO NOT INSTALL, USE OR COPY THE SOFTWARE.


  • You must agree to all of the terms of this EULA to use this Software.
  • If so, you may use the Software for free and for any lawful purpose.
  • This Software automatically communicates with its server for three reasons: (1) to receive and install updates; (2) to send error reports; and (3) to send anonymized usage information. You can view sample data to see what information is sent, and you may opt out of sending the anonymized usage data.
  • This Software is provided "as-is" with no warranties, and you agree that [[AUTHOR]] is not liable for anything you do with it.
heiswayi /
Last active Aug 18, 2019
Default font-family for web stuffs

Headings (H1-H6)

font-family: Roboto,-apple-system,BlinkMacSystemFont,"Helvetica Neue","Segoe UI","Oxygen","Ubuntu","Cantarell","Open Sans",sans-serif;


font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
heiswayi / gist:7775ec456f2e98b739a6c556a19e0cb1
Created Apr 26, 2018 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions
View gist:7775ec456f2e98b739a6c556a19e0cb1


Quick Legend

Instance Branch Description, Instructions, Notes
heiswayi / msbuild.ps1
Last active Apr 14, 2018
MSBuild PowerShell script
View msbuild.ps1
# msbuild.ps1
[CmdletBinding(PositionalBinding = $false)]
param (
[ValidateSet('Build', 'Clean', 'Rebuild')]
$Target = 'Build',
[ValidateSet('Release', 'Debug')]
$Configuration = 'Release',
heiswayi /
Last active Nov 6, 2018
Commonly Use Git Commands Notes

To delete a branch

Local branch: git branch -d <local_branch> Remote branch: git push origin --delete <remote_branch>

To create new branch from existing branch

git checkout -b <new_branch_name> <source_branch_name>
You can’t perform that action at this time.