Skip to content

Instantly share code, notes, and snippets.

@rahamatj
rahamatj / deploy.js
Last active November 13, 2025 18:42
#!/usr/bin/env node
const readline = require("readline");
const fs = require("fs");
const { execSync } = require("child_process");
const path = require("path");
const serverGithubUrl = "https://github.com/rahamatj/mern-ecom-server.git";
const clientGithubUrl = "https://github.com/rahamatj/mern-ecom-client.git";
@rahamatj
rahamatj / formData.js
Last active October 1, 2020 03:31
Creating FormData from complex data structures (nested array/objects)
const data = new FormData();
function appendToFormData(data, previousKey) {
if (data instanceof Object) {
Object.keys(data).forEach(key => {
const value = data[key];
if (previousKey) {
key = `${previousKey}[${key}]`;
}
if (value instanceof Object && !Array.isArray(value) && !(value instanceof File)) {
<html>
<script>
function openModal(modalId) {
$(modalId).css('opacity', 0)
.slideDown('slow')
.animate(
{ opacity: 1 },
{ queue: false, duration: 'slow' }
);
$('<div class="modal-backdrop"></div>').appendTo(document.body);