Skip to content

Instantly share code, notes, and snippets.

View mandaputtra's full-sized avatar
🚀
On my way building something ...

Manda Putra mandaputtra

🚀
On my way building something ...
View GitHub Profile
@mandaputtra
mandaputtra / README.md
Created July 26, 2023 01:29
Download with Content-Range in AWS S3 Bucket
View README.md

Need to enable in the S3 Bucket console

"ExposeHeaders": [
  "ETag",
  "Content-Length",
  "Range",
  "Content-Range"
]
@mandaputtra
mandaputtra / main.dart
Created June 20, 2023 09:14
poetic-aqueduct-9454
View main.dart
void main() {
// Ini adalah form question dan answer yang di isi oleh user
var listanswer = [
{ 'answer': 1, 'question': 1},
{ 'answer': 2, 'question': 2}
];
// ini data yang dikirim ke server
var dataDikirim = {
'ktp': 'ktp-kucing'
@mandaputtra
mandaputtra / index.js
Last active April 4, 2023 13:56
Stream video using node.js
View index.js
"use strict";
// Require the framework and instantiate it
import fastify from "fastify";
import fs from "node:fs";
import { join } from "node:path";
import { Readable } from "node:stream";
const app = fastify({ logger: true });
async function* streamFile() {
View README.md

3rd Lib

  • axios
  • fastify
  • fastify-multipart
View start.js
// print a name
function sayHello(name) {
console.log(`Hallo ${name} (^▽^)`)
}
// check if number are odd or even
function oddOrEven(num) {
if (num % 2 === 0) {
console.log('Genab')
} else {
@mandaputtra
mandaputtra / config.lua
Last active December 1, 2023 02:31
My lvim configuration
View config.lua
--[[
THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
`lvim` is the global options object
]]
-- vim options
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.relativenumber = true
-- general
@mandaputtra
mandaputtra / jwt-using-kong.md
Last active August 30, 2021 00:10
JWT Authentication using Kong
View jwt-using-kong.md

Run Kong Using Databases

$ docker run -d --name kong \
    --link kong-database:kong-database \
    -e "KONG_DATABASE=postgres" \
    -e "KONG_PG_HOST=kong-database" \
    -e "KONG_PG_PASSWORD=kong" \
    -e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
    -e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
@mandaputtra
mandaputtra / error.txt
Created December 4, 2019 16:49
Error CS:GO
View error.txt
SDL video target is 'x11'
This system supports the OpenGL extension GL_EXT_framebuffer_object.
This system supports the OpenGL extension GL_EXT_framebuffer_blit.
This system supports the OpenGL extension GL_EXT_framebuffer_multisample.
This system DOES NOT support the OpenGL extension GL_APPLE_fence.
This system DOES NOT support the OpenGL extension GL_NV_fence.
This system supports the OpenGL extension GL_ARB_sync.
This system supports the OpenGL extension GL_EXT_draw_buffers2.
This system DOES NOT support the OpenGL extension GL_EXT_bindable_uniform.
This system DOES NOT support the OpenGL extension GL_APPLE_flush_buffer_range.
@mandaputtra
mandaputtra / README.md
Last active October 16, 2019 10:33
RFC: Cara kerja kompresi kecilin pada browser dan server
View README.md

RFC: Cara Kerja Kecilin Compression Service Pada Browser

Penjelasan secara teknikal cara kerja servis kompresi kecilin, baik pada browser maupun pada proses pada saat di server

Browser

Gambar berikut menjelaskan cara kerja browser extension :

gambar

Berikut langkah langkahnya :

@mandaputtra
mandaputtra / dev-server.js
Created July 17, 2019 07:23
Chokidar Usage Example
View dev-server.js
#!/usr/bin/env node
/* I found this code somewhere in the wild if someone could reference it I would happy
* I'm creating this because my google search cant find it! It will run index.js
* and watch files under folder src. Thanks. tell me if you found the source of this code
* I'm glad to mention it here.
*/
/* eslint-disable no-path-concat */