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
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];
@heiswayi
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\heiswayi.nrird.com\_site"
set to="G:\GIT-REPOS\MyGitHub\heiswayi.github.io"
for %%i in (%to%\*) do (
del /S /Q %%i
)
for /d %%i in (%to%\*) do (
@heiswayi
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
<?php
$dir = 'inescov1';
$zip_file = 'inescov1.zip';
// Get real path for our folder
$rootPath = realpath($dir);
// Initialize archive object
$zip = new ZipArchive();
@heiswayi
heiswayi / EULA.md
Created Jun 3, 2018
Generic desktop app EULA sample
View EULA.md

END-USER LICENSE AGREEMENT

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.

Summary

  • 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
heiswayi / webfonts.md
Last active May 13, 2018
Default font-family for web stuffs
View webfonts.md

Headings (H1-H6)

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

Body

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

Branching

Quick Legend

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

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>
@heiswayi
heiswayi / SimplestLoggerUtility.cs
Created Mar 10, 2018
Simplest logger utility class using Windows built-in logging facility
View SimplestLoggerUtility.cs
using System;
using System.Diagnostics;
namespace SimplestLoggerUtility
{
public static class Logger
{
public static void Success(string message)
{
EventLog.WriteEntry(AppDomain.CurrentDomain.FriendlyName, message, EventLogEntryType.Information);
You can’t perform that action at this time.