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
heiswayi / .gitignore
Created Jan 30, 2020
.gitignore for VisualStudio, VisualStudioCode, Notepad++
View .gitignore
# Created by https://www.gitignore.io/api/notepadpp,visualstudio,visualstudiocode
# Edit at https://www.gitignore.io/?templates=notepadpp,visualstudio,visualstudiocode
### NotepadPP ###
# Notepad++ backups #
*.bak
### VisualStudioCode ###
.vscode/*
@heiswayi
heiswayi / git_log.sh
Created Jan 30, 2020
The ultimate graph display for your git log
View git_log.sh
git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
@heiswayi
heiswayi / .bashrc
Last active Jan 30, 2020
My LinuxLite .bashrc
View .bashrc
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
alias usage='du -sk * | sort -n | perl -ne '\''($s,$f)=split(m{\t});for (qw(K M G)) {if($s<1024) {printf("%.1f",$s);print "$_\t$f"; last};$s=$s/1024}'\'
@heiswayi
heiswayi / getFiles.py
Created Dec 31, 2019
Python script for getting a list of files in a directory
View getFiles.py
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
View keybase.md

Keybase proof

I hereby claim:

  • I am heiswayi on github.
  • I am heiswayi (https://keybase.io/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:

View git_examples.sh
#!/bin/bash
##########
# contents
##########
# contents
# notes
# script setup
# git config files
@heiswayi
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
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
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];
You can’t perform that action at this time.