Skip to content

Instantly share code, notes, and snippets.

View miteshmap's full-sized avatar
👨‍💻
Working from home

Mitesh Patel miteshmap

👨‍💻
Working from home
View GitHub Profile
class FrogBuilder {
constructor(name, gender) {
// Ensure that the first character is always capitalized
this.name = name.charAt(0).toUpperCase() + name.slice(1)
this.gender = gender
}
formatEyesCorrectly(eyes) {
return Array.isArray(eyes) ? { left: eye[0], right: eye[1] } : eyes
}
setEyes(eyes) {
@jamesstout
jamesstout / vagrant-vscode-php-xdebug-instructions.md
Last active August 5, 2021 19:29 — forked from sveggiani/instructions.md
Configure Xdebug, Visual Studio Code for a Vagrant VM

0. Assumptions

  • You've installed Xdebug in your VM.
  • You've installed Xdebug extension for VSCode and reloaded/restarted VSCode.
  • You have not forwarded port 9000 from the guest to the host.
  • Configure Debugger in VSCode. See item 1 next.

1. Configure .vscode/launch.json

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 23, 2024 17:36
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@miteshmap
miteshmap / query_alter.module
Created October 1, 2014 12:35
alter entity field query to print for debug
/**
* Implements hook_query_alter().
*/
function evosys_redirect_query_alter($query) {
if ($query->hasTag('debug')) {
$sql = (string)$query;
$connection = Database::getConnection();
foreach ((array) $query->arguments() as $key => $val) {
$quoted[$key] = $connection->quote($val);
}