Skip to content

Instantly share code, notes, and snippets.

View enkr1's full-sized avatar
🎯
If you actually try your best, you can't lose.

ENKR | Jing Hui PANG | 彭竞辉 enkr1

🎯
If you actually try your best, you can't lose.
View GitHub Profile
@mahdiyazdani
mahdiyazdani / class-methods-javascript.js
Created September 18, 2018 20:15
Class Methods in JavaScript
class Surgeon {
constructor(name, department) {
this._name = name;
this._department = department;
this._remainingVacationDays = 20;
}
get name() {
return this._name;
}
get department() {
@mahdiyazdani
mahdiyazdani / class-instance-javascript.js
Created September 18, 2018 19:57
Class Instance in JavaScript
class Surgeon {
constructor(name, department) {
this.name = name;
this.department = department;
}
}
const surgeonCurry = new Surgeon( 'Curry', 'Cardiovascular' );
const surgeonDurant = new Surgeon( 'Durant', 'Orthopedics' );
@mahdiyazdani
mahdiyazdani / search-field-for-wordpress-custom-post-type.php
Created September 8, 2018 23:30
Search field for WordPress custom post type
<form method="get" class="search-form" action="<?php echo home_url( '/' ); ?>" role="search">
<label>
<span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'textdomain' ); ?></span>
<input type="search" name="s" placeholder="<?php esc_attr_e( 'Search posts', 'textdomain' ); ?>" />
</label>
<input type="submit" class="search-submit" value="<?php esc_attr_e( 'Search', 'textdomain' ); ?>" />
<input type="hidden" name="post_type" value="custom_post_type" />
</form>
@mahdiyazdani
mahdiyazdani / query-posts-with-featured-images.php
Last active October 13, 2020 09:56
Query WordPress posts with featured images only
@bradtraversy
bradtraversy / docker-help.md
Last active October 20, 2025 10:11
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

Objective

The goal is being able to mix your microphone and desktop audio into a single track, while leaving Discord out of the equation. This allows you to stream your desktop audio and talk while in a call, without your partners hearing themselves.

Voicemeeter Setup

Download Voicemeeter

Voicemeeter Banana

@dikiaap
dikiaap / git-io-custom-url.md
Last active September 8, 2025 00:26
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
@mahdiyazdani
mahdiyazdani / get-dynamic-sidebar.php
Created February 1, 2018 13:12
Since there is NO "get_dynamic_sidebar" in the core, to return sidebar content instead of echoing out use the method below.
<?php
/**
* Gets the sidebar content based on given sidebar ID.
*
* @link https://forums.envato.com/t/get-dynamic-sidebar/76169/3?u=mypreview
* @param string $id ID of required registered sidebar.
* @return string|html The content of sidebar returned with HTML markup without "echo".
*/
if ( ! function_exists( 'prefix_get_dynamic_sidebar' ) ) :
Encoded Traversal Strings:
../
..\
..\/
%2e%2e%2f
%252e%252e%252f
%c0%ae%c0%ae%c0%af
%uff0e%uff0e%u2215
@zakkak
zakkak / .git-commit-template
Last active August 31, 2025 12:05 — forked from adeekshith/.git-commit-template.txt
This commit message template that helps you write great commit messages and enforce it across your team.
# [<tag>] (If applied, this commit will...) <subject> (Max 72 char)
# |<---- Preferably using up to 50 chars --->|<------------------->|
# Example:
# [feat] Implement automated commit messages
# (Optional) Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# (Optional) Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23