Skip to content

Instantly share code, notes, and snippets.

Finding inspirations...

Heiswayi Nrird heiswayi

Finding inspirations...
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 /
Created Dec 31, 2019
Python script for getting a list of files in a directory
import os
def getListOfFiles(dirName):
# create a list of file and sub directories
# names in the given directory
listOfFile = os.listdir(dirName)
allFiles = list()
# Iterate over all the entries
for entry in listOfFile:
# Create full path
View algorithms.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
public class Program
#region Bubble Sorts

Keybase proof

I hereby claim:

  • I am heiswayi on github.
  • I am heiswayi ( on keybase.
  • I have a public key whose fingerprint is 7F4E 5907 A6AB 0D10 BADC ABE3 B7B7 B2B1 9180 5E81

To claim this, I am signing this object:

# contents
# contents
# notes
# script setup
# git config files
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.
You can’t perform that action at this time.