Skip to content

Instantly share code, notes, and snippets.

View heiswayi's full-sized avatar
👽

Heiswayi Nrird heiswayi

👽
View GitHub Profile
@heiswayi
heiswayi / php-style-guide.md
Created September 23, 2015 05:38 — forked from ryansechrest/php-style-guide.md
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@heiswayi
heiswayi / malaysia.geojson
Last active October 7, 2024 06:36
Malaysia Map GeoJSON
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

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

Things I should be doing immediately for a happier life:

  • Stop regretting the past. Nothing can do about. Not to forget, but can learn from it so the repeating the mistakes.
  • Stop worrying for my future. Waste of energy. Waste of time.
  • Stop looking my happiness from other people.
Life Is A Gift
Today before you think of saying an unkind word–
think of someone who can’t speak.
Before you complain about the taste of your food–
think of someone who has nothing to eat.
Before you complain about your husband or wife–
think of someone who is crying out to God for a companion.
@heiswayi
heiswayi / google-dorks-2015.txt
Created October 26, 2015 07:14
Google Dorks List 2015
intitle:index.of .bash_history
intitle:index.of .sh_history
intitle:"Index of" index.html.bak
intitle:"Index of" index.php.bak
intitle:"Index of" index.jsp.bak
intitle:"Index of" ".htpasswd" htpasswd.bak
inurl:backup intitle:index.of inurl:admin
"Index of /backup"
intitle:"Index of" index.html~
intitle:"Index of" index.php~
@heiswayi
heiswayi / EULA.md
Last active July 9, 2024 14:06
Generic desktop app EULA sample

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 / SimpleAuth.php
Created December 20, 2017 14:28
Simple PHP script to protect any PHP page using session
<?php
/*
* Filename: SimpleAuth.php
* Version: 1.0
* Author: Heiswayi Nrird
* Dscription: Simple PHP script to protect any PHP page using session
* Website: https://heiswayi.nrird.com
*
* HOW TO USE
* ==========
@heiswayi
heiswayi / felleura.css
Last active May 15, 2024 10:13
This is the CSS template that I made for my Bear Blog, based on my old Jekyll blog theme. I licensed this under MIT license. Demo: https://felleura.bearblog.dev/desperat-igitur-pastoris/
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Grandstander:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');
:root {
--brand-color-1: #186cb8;
--brand-color-2: #2a9a9f;
--brand-color-3: #f1b211;
--brand-color-4: #e83611;
--brand-color-5: #f9002f;
--brand-green: #2ecc40;
--brand-yellow: #ffdc00;
--brand-red: #ff4136;
@heiswayi
heiswayi / utilities.cs
Last active April 3, 2024 14:29
C# utilities functions
// parse enum
public static T ParseEnum<T>(string value)
{
return (T)Enum.Parse(typeof(T), value, true);
}
// double to SI prefix
public string ToSI(double d, string format = null, bool spacing = true)
{
if (d == 0)