Skip to content

Instantly share code, notes, and snippets.

View Shervin1995's full-sized avatar
Enjoy ping pong!

Mohammad-Amin Khani Shervin1995

Enjoy ping pong!
View GitHub Profile
@Shervin1995
Shervin1995 / ajax.jsx
Created June 14, 2020 06:05
2020-june-14 | rest api - post method
let srial = `folderID=${folderID}&folderName=${folderName}`
let xhr = new XMLHttpRequest()
xhr.open('POST','http://localhost:8080/api/folder/'+courseName,true)
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
xhr.send(srial)
-------------------------------------------------------------------
{/*
Means1 >> I didnt use e.preventDefault() !
(
why? becuase see added folder WITHOUT refresh whole browser!
@Shervin1995
Shervin1995 / index.html
Last active August 27, 2020 13:34
2020-August-27 | juniorfrontend.ir
<!--
2020-August-27 by juniorfrontend.ir
-->
<style media="screen">
table{border: solid 1px; padding: 1em}
table td{padding: 1em;}
</style>
@Shervin1995
Shervin1995 / csv2list.js
Created November 19, 2022 23:12
convert csv to list, bafore change DSA to tree via d3.stratify( )
// --------------------------------------------------------
// Step 1
// --------------------------------------------------------
var data = [{
country: "Iran", city: "Tehran", district: 22, size: 1200
},{
country: "Iran", city: "Tehran", district: 6, size: 1200