View JsPayPalCurrencyConvert
console.log(convertCurrency("100000", "SEK", "USD")); | |
function convertCurrency(currencyAmount, currencyFrom, currencyTo) { | |
var xhr = new XMLHttpRequest(); | |
var url = "https://devtools-paypal.com/apiexplorer/processReq"; | |
//url="https://svcs.sandbox.paypal.com/AdaptivePayments/ConvertCurrency"; | |
var bigO = {}; | |
bigO.httpMethod = "POST"; | |
bigO.oauth = ""; | |
bigO.methodUri = ""; |
View PhpPayPalConvertCurrency.php
<?php | |
var_dump(convertCurrency("100000",'USD','GBP')); | |
function convertCurrency($currencyAmount, $currencyFrom, $currencyTo) { | |
// https://developer.paypal.com/docs/classic/api/adaptive-payments/ConvertCurrency_API_Operation/ | |
$bigO = array(); | |
$bigO['userName'] = 'jb-us-seller_api1.paypal.com'; //this is a official paypal test account.. | |
$bigO['password'] = 'WX4WTU3S8MY44S7F'; | |
$bigO['signature'] = 'AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy'; |
View c++ to_string.cpp
template<typename X> | |
std::string to_string(X s) | |
{ | |
std::stringstream ret; | |
ret << s; | |
return ret.str(); | |
} |
View gist:746140813eb79adb67fb
Keep in mind that talking to a woman for the first time is not a job interview, however similar the two might seem. Excerpt your resume sparingly. | |
Want more Men's Health? Subscribe today and get a Risk-Free Trial Issue | |
« PREV | |
NEXT » | |
PRINTEREMAILFACEBOOKTWITTERDIGGSTUMBLE UPONREAD ON 1 PAGE | |
356 COMMENTS ON THIS LIST | |
6 COMMENTS ON THIS PAGE | |
0) { $error_message.=$COM_LANG['not_allowed'] . " | |
"; } if ($_REQUEST['disc_name'] == '') { $error_message.=$_REQUEST['r_disc_name'] . " | |
"; } if ($_REQUEST['disc_body'] == '') { $error_message.=$_REQUEST['r_disc_body'] . " |
View foo.js
// run at https://console.online.net/en/order/server | |
(function () { | |
var servers = document.querySelectorAll(".server-availability > tbody > tr"), | |
i = 0, | |
tds = [], | |
server = { | |
name: "", | |
CPU: "", | |
RAM: "", | |
parsedRAM: "", |
View x11vnc
x11vnc -passwdfile filename -auth /var/lib/lightdm/.Xauthority -reopen -shared -forever -loop -solid darkblue |
View etc init.d x11vnc
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: x11vnc | |
# Required-Start: lightdm | |
## Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: x11vnc initscript | |
# Description: x11vnc initscript.. This file should probably be placed in /etc/init.d. | |
### END INIT INFO |
View cppBenchmark.cpp
unsigned __int64 freq; | |
QueryPerformanceFrequency((LARGE_INTEGER*)&freq); | |
double timerFrequency = (1.0 / freq); | |
unsigned __int64 startTime; | |
QueryPerformanceCounter((LARGE_INTEGER *)&startTime); | |
int_fast32_t i = 0; | |
for (i = 0; i < 1000; ++i){ | |
Sleep(1); | |
} |
View PHP upload file
<?php | |
header("Access-Control-Allow-Origin: *"); | |
header("Access-Control-Allow-Credentials: true"); | |
echo '<pre>'; | |
ob_start(); | |
var_dump('$_GET',$_GET,'$_POST',$_POST,'$_COOKIE',$_COOKIE,'$_FILES',$_FILES); | |
echo htmlentities(ob_get_clean(),ENT_SUBSTITUTE).'</pre>'; | |
?> |
View MyFormData
function MyFormData(){ | |
var data=[]; | |
this.append=function append(name,value){ | |
data.push([name.toString(),value.toString()]); | |
}; | |
this.toString=function toString(){ | |
var ret=""; | |
encodeURIComponent | |
var i=0; | |
for(;i<data.length;++i){ |
OlderNewer