Skip to content

Instantly share code, notes, and snippets.

View pooyaEst's full-sized avatar
📈

pooya Games pooyaEst

📈
View GitHub Profile
/**
* linking prototype objects to build a prototype chain
* __proto__ vs Object.getPrototypeOf(obj) & Object.setPrototypeOf(obj)
*/
// 1. obj --> otherProto.prototype --> Object.prototype --> null
let otherProto = function() {
this.prop1 = 456; // this means the instance of the object we are creating
this.inner = function() {
console.log("inner method on instance");
@sveggiani
sveggiani / instructions.md
Last active July 15, 2023 21:52
[Configure XDebug, Visual Studio Code for a Vagrant VM] #debug #vm #vscode #masscode

Configure XDebug, Visual Studio Code for a Vagrant VM

1. Assumptions

  • Project (Drupal) is served on /var/www/html in the Vagrant box
  • Local project files location: c:\Users\username\Work\projects\my-project\repo\html
  • Guest machine IP is 10.0.2.2 (if this doesn't work, run route -nee in the VM and look for the gateway address)

2. Configuration

@philipstanislaus
philipstanislaus / gist:c7de1f43b52531001412
Last active February 12, 2025 13:46
JavaScript: Save a blob to disc
var saveBlob = (function () {
var a = document.createElement("a");
document.body.appendChild(a);
a.style = "display: none";
return function (blob, fileName) {
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = fileName;
a.click();
window.URL.revokeObjectURL(url);