Skip to content

Instantly share code, notes, and snippets.

View hectorromo's full-sized avatar

Hector Romo hectorromo

View GitHub Profile

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@chranderson
chranderson / nvmCommands.js
Last active September 9, 2025 08:39
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@jnewman12
jnewman12 / AdvancedMongoose.md
Last active August 22, 2023 20:45
Advanced Mongoose

Advanced Mongoose

advanced mongoose


Objectives

  • Define virtual properties for a model
  • Modify how a model is serialized to JSON
@AshikNesin
AshikNesin / react-file-upload.js
Created February 2, 2017 06:46
Simple React File Upload
import React from 'react'
import axios, { post } from 'axios';
class SimpleReactFileUpload extends React.Component {
constructor(props) {
super(props);
this.state ={
file:null
}
@tmakin
tmakin / ExportPdf.cs
Last active October 24, 2024 21:21
Create PDF Rendering service in Azure Functions
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using DinkToPdf;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using IPdfConverter = DinkToPdf.Contracts.IConverter;
@hikoz
hikoz / layout.js
Created March 3, 2017 05:22
active tab with preact-router
import { h, Component } from 'preact';
import { Router, Link } from 'preact-router';
function Header({url}) {
const NavItem = ({href, children}, state) => (
<li className={href==url ? 'is-active' : ''}><Link href={href}>{children}</Link></li>
)
return (
<section class="hero is-primary">
<div class="hero-foot">
@atinux
atinux / async-foreach.js
Last active April 2, 2025 11:34
JavaScript: async/await with forEach()
const waitFor = (ms) => new Promise(r => setTimeout(r, ms))
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array)
}
}
const start = async () => {
await asyncForEach([1, 2, 3], async (num) => {
await waitFor(50)
@fre-sch
fre-sch / app.jsx
Created March 12, 2018 06:48
preact drag and drop
import {h, Component} from "preact"
const lorem = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."
class DndListItem extends Component {
render({onDragStart, children}) {
return (
<div class="dnd-list-item"
draggable="true"
onDragStart={onDragStart}>
@ontiuk
ontiuk / woocommerce-select2-selectwoo-remove
Last active May 21, 2025 14:27
Woocommerce Remove Select2 / SelectWoo
// Add to your theme's functions.php file. De-queues Select2 styles & scripts. Useful to keep Boostrap form control formatting
/**
* Remove Woocommerce Select2 - Pre WC 3.2.1-ish
*/
function woo_dequeue_select2() {
if ( class_exists( 'woocommerce' ) ) {
wp_dequeue_style( 'select2' );
wp_deregister_style( 'select2' );
@WebInspectInc
WebInspectInc / docker-compose.yml
Created June 5, 2018 01:50
A basic Docker Compose file for WordPress
version: '3'
services:
mysql:
image: mysql:5.7
volumes:
- ./db:/docker-entrypoint-initdb.d
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress