Skip to content

Instantly share code, notes, and snippets.

<?php
//testing php curl
$authURL = 'https://someapi.com/rest/Authentication';
$userName = 'userName';
$apiKey = 'passwords';
$proxyHost = 'host';
$proxyPort = 1111;
@anandsunderraman
anandsunderraman / requestTest.js
Last active December 18, 2015 22:09
Gist to POST a request using node.js request module
var request = require('request');
function postRequest(post_data,responseObject)
{
var url = 'http://www.example.com';
var proxy_opt = 'http://domain:port';
var post_options = {
uri:url,
@anandsunderraman
anandsunderraman / gist:5852834
Created June 24, 2013 19:34
Regular Expression to Format Currency In Javascript
function formatCurrency(amount)
{
//truncate the amount to 0 decimals
//for every digit that is followed by 3 digits and a word boundary
//add a comma
amount = amount.toFixed(0).replace(/(\d)(?=(\d{3})+\b)/g, "$1,");
return amount;
}