Skip to content

Instantly share code, notes, and snippets.

View mpalmr's full-sized avatar

Matthew Palmer mpalmr

  • Compass Digital
  • Toronto
View GitHub Profile
var date = new Date()
var j = date.getDate()
var suf = ['th', 'st', 'nd', 'rd']
var v = j
var S = (suf[(v-20) % 10] || suf[v] || suf[0])
var months = ['January','February','March','April','May','June','July','August','September','October','November','December']
var F = months[date.getMonth()]
var Y = date.getFullYear()
var formatted_date = (F + ' ' + j+S + ', ' + Y)
<script>
// alert("test");
var req = new XMLHttpRequest();
req.open("POST", "/api/login");
req.send(JSON.stringify({"username":"test", "password":"password123"});
</script>