Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍👩‍👧
Finding inspirations...

Heiswayi Nrird heiswayi

👨‍👩‍👧
Finding inspirations...
View GitHub Profile
@heiswayi
heiswayi / repo-reset.md
Created Feb 5, 2017
GitHub - Delete commits history with git commands
View repo-reset.md

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@heiswayi
heiswayi / privacy-policy.md
Last active Feb 11, 2021 — forked from maddisondesigns/cookie-policy.md
eCommerce Terms & Conditions and Privacy Templates
View privacy-policy.md

Privacy Policy

1. We respect your privacy

Business Name respects your right to privacy and this policy sets out how we collect and treat your personal information. “Personal information” is information we hold which is identifiable as being about you.

2. What personal information we collect

@heiswayi
heiswayi / SerialPortReader.ps1
Last active Feb 10, 2021
PowerShell Script - Serial Port Reader
View SerialPortReader.ps1
<#
.SYNOPSIS
Listens to and read data from a serial port (e.g. COM port)
.DESCRIPTION
The purpose of this script is to keep listening and read data from a serial port.
All the data captured will be displayed and log into a file.
.EXAMPLE
./SerialPortReader.ps1
.EXAMPLE
./SerialPortReader.ps1 -PortName COM3 -BaudRate 9600
@heiswayi
heiswayi / malaysia.geojson
Last active Feb 8, 2021
Malaysia Map GeoJSON
View malaysia.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View dispatch-service.cs
public static class DispatchService
{
public static void Invoke(Action action)
{
Dispatcher dispatchObject = Application.Current.Dispatcher;
if (dispatchObject == null || dispatchObject.CheckAccess())
{
action();
}
else
View fixed-sized-queue.cs
public class FixedSizedQueue<T> : ConcurrentQueue<T>
{
private readonly object syncObject = new object();
public int Size { get; private set; }
public FixedSizedQueue(int size)
{
Size = size;
}
View responsive-basic.scss
@media only screen and (max-width: 480px) {
/* Mobile Styles Go Here */
}
@media only screen and (min-width: 481px) and (max-width: 768px) {
/* Tablet Styles Go Here */
}
@media only screen and (min-width: 769px) {
/* Desktop Styles Go Here */
View SimpleLogger.cs
/*
MIT License
Copyright (c) 2016 Heiswayi Nrird
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@heiswayi
heiswayi / EULA.md
Last active Jan 30, 2021
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.