Skip to content

Instantly share code, notes, and snippets.

View ErikThiart's full-sized avatar
💭
First, solve the problem. Then, write the code.

Erik Thiart ErikThiart

💭
First, solve the problem. Then, write the code.
View GitHub Profile
@ErikThiart
ErikThiart / index.php
Created August 1, 2018 18:36
Example: Re-write this using C# and WPF/WinForms
<?php
/*
* This pulls in the data from an external source
* This will probably be stored and retreived from a DB in real life
* See this piece of code as the C# code for the winform
*/
$json = file_get_contents('https://coindata.co.za/api.php');
$coins = json_decode($json);
?>
@ErikThiart
ErikThiart / php-nusoap.php
Created August 1, 2018 09:55
PHP7 nusoap library
<?php
/*
$Id: nusoap.php,v 1.123 2010/04/26 20:15:08 snichol Exp $
NuSOAP - Web Services Toolkit for PHP
Copyright (c) 2002 NuSphere Corporation
This library is free software; you can redistribute it and/or
@ErikThiart
ErikThiart / Concurrency Prices - Updated Daily
Created January 5, 2018 20:49
Cryptocurrency market cap rankings, prices and more.
Donate
BTC: 1L1Bbfm6TjAMcBhgGJ6c9ZXCNMzrDijkMf
LTC: LcNa8XKqimLjXDGck7dPnxEjENPm9t6r3H
DGB: D7WMFy8fBzhb3tEhMM6XZ6swRfiYbPkoFq
Civic: 0x6c793ae7749acd19c8b4a77aa72d01cd0263f137
This list will be updated daily
Last updated 01/05/2018
-----------------------
[
{
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,500,700");
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,inp
<?php
// define variables and set to empty values in ni particular order
$nameErr = $emailErr = $genderErr = $websiteErr1 = $websiteErr2 = "";
$name = $email = $gender = $comment = $website1 = $website2 = "";
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;