Skip to content

Instantly share code, notes, and snippets.

View ankitraturi's full-sized avatar

Ankit Raturi ankitraturi

View GitHub Profile
@ankitraturi
ankitraturi / ConvertCurrency.php
Last active April 12, 2018 05:28
XE Live currency conversion in PHP
function convertCurrency($from = null, $to = null, $amt = null) {
$url = "https://www.xe.com/currencyconverter/convert/?Amount=$amt&From=$from&To=$to";
$ch = curl_init(); // Initialize a CURL session.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Return Page contents.
curl_setopt($ch, CURLOPT_URL, $url); // Pass URL as parameter.
$data = curl_exec($ch); // grab URL and pass it to the variable.
curl_close($ch); // close curl resource, and free up system resources.
/*
This CSS is used for responsive tables.
id of the table parent should be 'no-more-tables'.
table should have class 'table'
*/
table {
width: 100%;
border-collapse: collapse;
}
<?php
/**
* @author Anush Prem <goku.anush@gmail.com>
* @package Solver
* @subpackage Sudoku
* @version 0.1
*/
/**
@ankitraturi
ankitraturi / breadthFirstSearch
Last active August 29, 2015 14:17
Breadth First Search in PHP for binary tree
<?php
Class Test extends SplQueue
{
}
$queue = [];
//SplQueue new object
$dummyQueue = new test();
@hjr3
hjr3 / linkedin-api-invite
Created November 22, 2011 16:11
Simple example of using the LinkedIn JavaScript SDK to send an invite
<!DOCTYPE html>
<html>
<head>
<script>
function invite() {
var url = '/people/~/mailbox',
body = {
recipients: {
values: [{
person: {
@aliendeveloper
aliendeveloper / SudokuSolver.class.php
Created March 27, 2011 08:35
A PHP Class to solve the sudoku.
<?php
/**
* @author Anush Prem <goku.anush@gmail.com>
* @package Solver
* @subpackage Sudoku
* @version 0.1
*/
/**