Skip to content

Instantly share code, notes, and snippets.

View hyokosdeveloper's full-sized avatar
🍉
7342 commits and counting...

hyokos hyokosdeveloper

🍉
7342 commits and counting...
  • Descartes
  • New York City
  • 20:37 (UTC -04:00)
View GitHub Profile
@hyokosdeveloper
hyokosdeveloper / better-nodejs-require-paths.md
Created April 11, 2025 10:39 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@hyokosdeveloper
hyokosdeveloper / openstackcli.sh
Last active April 5, 2025 21:05
BASH Utility for easy openstack tasks
# ** ref to open stack rc containing envvars and credentials **
OPENSTACKRC=./openstackrc.sh
#
# Functions
#
connect(){
@hyokosdeveloper
hyokosdeveloper / useful-npx-commands.md
Created September 15, 2023 19:24 — forked from gokulkrishh/useful-npx-commands.md
List of useful npx (Node Package Runner) commands (https://git.io/useful-npx-commands)

NPX (NPM Package Runner) Commands

List of useful npx (NPM Package Runner) commands.

What is NPX?

Using NPX we can execute/run node binaries without the need to install it locally or globally.

Commands

@hyokosdeveloper
hyokosdeveloper / backup.sh
Created February 4, 2023 00:47
Compressed archive of web projects hosted on Linux server using bash
#!/bin/bash
# get size of tgz in kilobytes:
# tar -czf - comingsoon.20230202-040946.tgz | wc -c
# handle remove leading / from member warning
# #tar czfP ./htdocs.tgz ../../htdocs
NOW=$( date '+%F_%H:%M:%S' )
TIMESPAMP=$(date +%Y%m%d-%H%M%S)
UP_DIR=../
# -- Dir Paths
@hyokosdeveloper
hyokosdeveloper / updateNpm.bat
Created October 6, 2022 16:28 — forked from johnmcase/updateNpm.bat
Update npm on windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
@fardjad
fardjad / how-to-install-homebrew-on-debian-based-distros.md
Last active February 17, 2025 02:00
[How to Install Homebrew on Debian-based Distros] Steps required to install homebrew on MX Linux (and other Debian-based distros) #linux #debian #mxlinux #homebrew

How to Install Homebrew on Debian-based Distros

Steps required to install Homebrew on MX Linux (and other Debian-based distros)

Steps

  1. Update apt cache and optionally do a full upgrade

     apt update
    

apt full-upgrade # optional, reboot if needed

@hyokosdeveloper
hyokosdeveloper / supervisord-example.conf
Created April 18, 2022 20:22 — forked from didip/supervisord-example.conf
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon

After Sierra upgrade, all my JDK were removed. So here is how I reinstalled all of them with only brew commands, and manage them with jEnv.

First do all your mac updates (especially XCode), then:

Install Brew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@hyokosdeveloper
hyokosdeveloper / gulpfile.js
Created January 6, 2021 23:22 — forked from floatdrop/gulpfile.js
gulp.src - working with multiple source in one task
// npm i gulp event-stream
var gulp = require('gulp');
var es = require('event-stream');
gulp.task('test', function(cb) {
return es.concat(
gulp.src('bootstrap/js/*.js')
.pipe(gulp.dest('public/bootstrap')),
gulp.src('jquery.cookie/jquery.cookie.js')
@hyokosdeveloper
hyokosdeveloper / index.js
Last active November 29, 2020 18:36 — forked from Tynael/README.md
How to use npx to run gist based scripts
#!/usr/bin/env node
// -- required imports
var os = require('os');
console.log("Execution of zeusbase remote operation started.");
// -- perform task
console.log("Platform: " + os.platform());
console.log("Architecture: " + os.arch());