Skip to content

Instantly share code, notes, and snippets.

View harrymahardhika's full-sized avatar

Harry Mahardhika harrymahardhika

View GitHub Profile
{
"ClientInfo": {
"UserName": "{{username}}",
"Password": "{{password}}",
"Version": "v1.0",
"AccountNumber": "{{account_number}}",
"AccountPin": "{{account_pin}}",
"AccountEntity": "JKT",
"AccountCountryCode": "ID"
},
npm init -y
npm install express dotenv nodemon
touch app.js
touch server.js
echo "import app from './app.js'
const port = process.env.APP_PORT || 3000
app.listen(port, () => {
@harrymahardhika
harrymahardhika / .gitignore
Created January 9, 2024 03:28
js-project-gitignore
# Dependency directories
node_modules/
# Environment configuration files
.env
# Logs
logs/
*.log
npm-debug.log*
@harrymahardhika
harrymahardhika / joshwcomeau-reset.css
Last active December 21, 2023 16:05
joshwcomeau-reset.css
/*
Josh's Custom CSS Reset
https://www.joshwcomeau.com/css/custom-css-reset/
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
* {
@harrymahardhika
harrymahardhika / .prettierrc
Created December 21, 2023 15:57
.prettierrc
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
@harrymahardhika
harrymahardhika / js-example-01.js
Last active December 5, 2023 11:08
js-example-01
/**
* Generates a Fibonacci sequence of a given length.
* @param {number} length - The length of the Fibonacci sequence to generate.
* @returns {number[]} - The Fibonacci sequence as an array.
*/
function fibonacci(length) {
let fibArr = [0, 1]
for (let i = 2; i < length; i++) {
fibArr.push(fibArr[i - 2] + fibArr[i - 1])
}
@harrymahardhika
harrymahardhika / array-practice.js
Last active December 5, 2023 10:25
Array Practice
const skills = ['react', 'mysql', 'typescript', 'nodejs']
skills.pop()
skills.push('javascript')
skills.shift()
skills.unshift('html')
console.log(skills.map((skill) => skill.toUpperCase()))
const numbers = [2, 2]
const sum = numbers.reduce(function (accumulator, currentValue) {
return accumulator + currentValue
<?php
namespace App\Observers;
use App\Journal;
use Illuminate\Support\Facades\Log;
class JournalObserver
{
public function creating(Journal $journal): void
@harrymahardhika
harrymahardhika / .php_cs.dist
Created March 31, 2019 03:48
php-cs-fixer config
<?php
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/app',
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__ . '/routes',
__DIR__ . '/tests',
]);
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
end_of_line = lf
insert_final_newline = true