Skip to content

Instantly share code, notes, and snippets.

@Choirrulloh
Choirrulloh / execute.js
Created March 2, 2021 01:40 — forked from harrypujols/execute.js
Execute shell command in javascript
#!/usr/bin/env node
function execute(command) {
const exec = require('child_process').exec
exec(command, (err, stdout, stderr) => {
process.stdout.write(stdout)
})
}
@Choirrulloh
Choirrulloh / Install Composer using MAMP's PHP.md
Created August 26, 2020 13:08 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@Choirrulloh
Choirrulloh / main.js
Created August 2, 2020 00:01 — forked from febritecno/main.js
contoh bot wa tanpa API (whatsapp-web.js)
const { Client } = require('whatsapp-web.js');
const qrCode = require('qrcode');
const http = require('http');
const request = require('request');
const client = new Client();
const stop = "\n\n===============\nBalas pesan ini dengan *stop* untuk berhenti automasi Covid19"
const penggunaAksi = new Map();
@Choirrulloh
Choirrulloh / short-number-format.php
Created April 20, 2018 12:46 — forked from RadGH/short-number-format.php
Short Number Formatter for PHP (1000 to 1k; 1m; 1b; 1t)
<?php
// Converts a number into a short version, eg: 1000 -> 1k
// Based on: http://stackoverflow.com/a/4371114
function number_format_short( $n, $precision = 1 ) {
if ($n < 900) {
// 0 - 900
$n_format = number_format($n, $precision);
$suffix = '';
} else if ($n < 900000) {